天天看点

Idea用maven给springBoot打jar包报错1、错误描述2、问题分析3、原因

1、错误描述

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file (default-cli) on project whitelist_savetxt: The parameters 'file' for goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file are missing or invalid -> [Help 1]

[WARNING] 
[WARNING] Some problems were encountered while building the effective settings
[WARNING] expected START_TAG or END_TAG not TEXT (position: TEXT seen ...</mirror>\n     -->\n\t <mirror>\n\ua0 \ua0 \ua0 <i... @160:9)  @ C:\MyselfApplication\WinSoft\Maven\apache-maven-3.5.0\conf\settings.xml, line 160, column 9
[WARNING] expected START_TAG or END_TAG not TEXT (position: TEXT seen ...</mirror>\n     -->\n\t <mirror>\n\ua0 \ua0 \ua0 <i... @160:9)  @ C:\MyselfApplication\WinSoft\Maven\apache-maven-3.5.0\conf\settings.xml, line 160, column 9
[WARNING] 
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building whitelist_savetxt 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install-file (default-cli) @ whitelist_savetxt ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.427 s
[INFO] Finished at: 2020-04-09T14:50:58+08:00
[INFO] Final Memory: 13M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file (default-cli) on project whitelist_savetxt: The parameters 'file' for goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file are missing or invalid -> [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/PluginParameterException
           

2、问题分析

之所以造成上面的错误我是使用Plugins下的Install/install:install打的jar包,每次都不成功;

Idea用maven给springBoot打jar包报错1、错误描述2、问题分析3、原因

最后使用Lifecycle下面的install就可以打包成功

Idea用maven给springBoot打jar包报错1、错误描述2、问题分析3、原因

3、原因

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file (default-cli) on project whitelist_savetxt: The parameters 'file' for goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file are missing or invalid -> [Help 1]

上面错误是说找不到插件的包,其实不是找不到这个打包插件,而是自己的项目没有从maven仓库里加载这个包到项目里,

idea中打包maven项目,有两个install;有时候一直就用Plugins下的install,并不知道Lifecycle中的install,其实lifecycle是maven中一个十分完善的生命周期模型,所以使用Lifecycle中的install项目就会自动去maven仓库下载需要的包。