如何在Eclipse上修复此maven警告:"没有为此pom.xml定义架构"

时间:2016-05-27 18:17:39

标签: eclipse maven pom.xml

所以我在下面有一个非常简单的pom.xml:

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany</groupId>
  <artifactId>kafka-utils</artifactId>
  <version>1.1.1</version>

  <dependencies>
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-clients</artifactId>
    <version>0.10.0.0</version>
</dependency>
  </dependencies>

</project>

但是eclipse在<project>行上给出了以下警告:

There is no schema defined for this pom.xml!

见下图:

enter image description here

1 个答案:

答案 0 :(得分:7)

如错误所示,您缺少架构声明

  <project   xmlns="http://maven.apache.org/POM/4.0.0" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/maven-4.0.0.xsd">

    </project>