Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install)

idea本地打包、install项目时,报错如下

[INFO] --- maven-source-plugin:3.0.1:jar (attach-sources) @ bl-mall-trade-impl ---
[INFO] Building jar: E:\workspace\bl-mall-trade\bl-mall-trade-impl\target\bl-mall-trade-impl-2.0.0-SNAPSHOT-sources.jar
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ bl-mall-trade-impl ---
[INFO] Installing E:\workspace\bl-mall-trade\bl-mall-trade-impl\target\bl-mall-trade-impl-2.0.0-SNAPSHOT.jar to E:\workspace\maven\apache-maven-3.6.2-bin\apache-maven-3.6.2\repoitory\com\dffl\bl-mall-trade-impl\2.0.0-SNAPSHOT\bl-mall-trade-impl-2.0.0-SNAPSHOT.jar
[INFO] Installing E:\workspace\bl-mall-trade\bl-mall-trade-impl\pom.xml to E:\workspace\maven\apache-maven-3.6.2-bin\apache-maven-3.6.2\repoitory\com\dffl\bl-mall-trade-impl\2.0.0-SNAPSHOT\bl-mall-trade-impl-2.0.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 31.769 s
[INFO] Finished at: 2020-05-18T10:17:26+08:00
[INFO] Final Memory: 112M/1042M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project bl-mall-trade-impl: Failed to install metadata com.dffl:bl-mall-trade-impl/maven-metadata.xml: Could not parse metadata E:\workspace\maven\apache-maven-3.6.2-bin\apache-maven-3.6.2\repoitory\com\dffl\bl-mall-trade-impl\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

Process finished with exit code 1

**

解决办法:

**
1.把maven日志调整成debug模式,重新打包会发现maven报错日志,如下图:
Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install)_第1张图片

完整的报错信息:(说明此文件有问题)

Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to install metadata com.dffl:bl-mall-trade-impl/maven-metadata.xml: Could not parse metadata E:\workspace\maven\apache-maven-3.6.2-bin\apache-maven-3.6.2\repoitory\com\dffl\bl-mall-trade-impl\maven-metadata-local.xml: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1)

2.找到本地maven仓库,然后找到报错信息所提及的目录:
Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install)_第2张图片
文件内容:
Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install)_第3张图片
3.把此文件删除(项目重新打包会自动生成正确的该文件),然后重新install项目,项目打包成功!
Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install)_第4张图片

原因:

个人也不是很确定是什么原因,但是有一点,个人的电脑最近懂不懂就蓝屏重启,然后就发生出很多意想不到错误,然后就闷头找问题;哎!
工欲善其事,必先利其器,还是需要一台好电脑呀!

你可能感兴趣的:(idea,spring,boot2,maven)