【发布时间】:2019-03-02 10:26:45
【问题描述】:
我正在尝试创建 Maven SpringBoot 项目以使用 spring restTemplate。 我从https://spring.io/guides/gs/consuming-rest/ 获得此代码。当我运行 mvn compile 时,我得到错误 start tag not allowed in epilog 但得到 p (position: END_TAG seen ...\n\n
这是堆栈跟踪
INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the
POMs:
[FATAL] Non-parseable POM /Users/
../.m2/repository/org/eclipse/jetty/jetty-bom/9.4.12.v20180830/jetty-
bom-9.4.12.v20180830.pom: start tag not allowed in epilog but got p
(position: END_TAG seen ...</profiles>\n</project>\n<p... @507:3) @
/Users/../.m2/repository/org/eclipse/jetty/jetty-bom/9.4.12.v20180830/jetty-bom-9.4.12.v20180830.pom, line 507, column 3
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.springframework:gs-consuming-rest:0.1.0 (..gs-consuming-rest-master/complete/pom.xml) has 1 error
[ERROR] Non-parseable POM ../.m2/repository/org/eclipse/jetty/jetty-bom/9.4.12.v20180830/jetty-bom-9.4.12.v20180830.pom: start tag not allowed in epilog but got p (position: END_TAG seen ...</profiles>\n</project>\n<p... @507:3) @ /Users/../.m2/repository/org/eclipse/jetty/jetty-bom/9.4.12.v20180830/jetty-bom-9.4.12.v20180830.pom, line 507, column 3 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException"
这里是 POM http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>org.springframework</groupId>
<artifactId>gs-consuming-rest</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
【问题讨论】:
-
请更新 POM 文件,因为它看起来与教程中的不同。
-
您使用的 Maven 和 Java 版本是多少?您是从 Eclipse 构建它吗?如果您从终端执行此操作会发生什么?
标签: maven spring-boot pom.xml