错误 LifecyclePhaseNotFoundException,Unknown lifecycle phase "mvn". You must specify a valid lifecycle

版权声明:本文为博主原创文章,欢迎转载,转载请注明出处。觉得此文有用的,不嫌麻烦的,就留个言呐,或者点个赞呐,要是嫌麻烦呢,也麻烦点个赞嘛 https://blog.csdn.net/qq_40147863/article/details/88892207

错误 LifecyclePhaseNotFoundException,Unknown lifecycle phase “mvn”. You must specify a valid lifecycle

执行 Maven 命令报错

Unknown lifecycle phase “”. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. 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-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [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

原因及解决方法:

原因:
使用 IDEA 或者 Eclipse Maven 插件执行 Maven 命令时多输入了 mvn 命令
,因为 IDEA 和 Eclipse Maven 插件已经帮你加上了 mvn 的命令前缀,再手动输出 mvn clean install 之类的 命令就会变成 mvn mvn clean install

例如:
在 Command line 中是不能再输入 mvn 的

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_40147863/article/details/88892207