我正在尝试学习如何使用Apache Maven。我在Eclipse中编写了这段代码,它显示了消息:
文档中没有引用语法约束(DTD或XML Schema)。
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>br.gov.mdic</groupId>
<artifactId>Offset</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
答案 0 :(得分:1)
您必须在<project>
代码
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>