解决Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install的错误

环境:idea编译器,SSM框架。

一.报错:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install) on project XXX: Failed to install metadata XXX/maven-metadata.xml: Could not parse metadata 路径\maven-metadata-local.xml: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) -> [Help 1]
[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/MojoExecutionException
[ERROR] Maven execution terminated abnormally (exit code 1)

Java项目编译时报错。

二.原因:

不能编译xx路径下的maven-metadata-local.xml,这个maven-metadata-local.xml的作用是记录了项目元数据,例如groupId,artifactId,version。我们的每次提交都会更新maven-metadata-local.xml,当在maven仓库下载jar包时,也会根据这个文件进行jar包的查找。

没有关项目,又直接运行了,maven-metadata-local.xml被占用无法编译。

三.解决:

找到路径下的maven-metadata-local.xml,删除掉,然后clean一下项目就可以了。

猜你喜欢

转载自blog.csdn.net/lcgoing/article/details/84941390