How to fix this maven warning on Eclipse: “There i

2020-04-12 07:08发布

问题:

So I have the very simple pom.xml below:

<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>

But eclipse gives me the following warning, on the <project> line:

There is no schema defined for this pom.xml!

See the image below:

回答1:

Like the error says you are missing the schema declaration

  <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>