Unknown lifecycle phase "mvn". You must specify a valid lifecycle phase or a goal

用Eclipse集成的Maven打包项目时按照网上所述输入 mvn clean package遇到

Unknown lifecycle phase "mvn". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException

原来是Eclipse已经集成Maven,所以就不需要mvn命令了

在Run as Configurations中Goals输入clean package打包成功

发布了69 篇原创文章 · 获赞 16 · 访问量 22万+

猜你喜欢

转载自blog.csdn.net/huanglei1234567890/article/details/103597645