我正在尝试创建Maven SpringBoot项目以使用spring restTemplate。 我从https://spring.io/guides/gs/consuming-rest/获得此代码。当我运行mvn compile时,我得到Epilog不允许的错误开始标记,但得到p(位置:END_TAG见... \ 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>
答案 0 :(得分:1)
错误不是来自pom,而是来自本地存储库中的码头pom:
[FATAL] Non-parseable POM /Users/
../.m2/repository/org/eclipse/jetty/jetty-bom/9.4.12.v20180830/jetty-
bom-9.4.12.v20180830.pom
因此,请检查pom并鉴于其下载不正确,只需删除整个文件夹/Users/../.m2/repository/org/eclipse/jetty/jetty-bom/9.4.12.v20180830
并重新运行构建