錯誤LifecyclePhaseNotFoundException,Unknown lifecycle phase "mvn". You must specify a valid lifecycle

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/LifecyclePhaseNotFoundExceptionapache

  • 緣由1:

使用Eclipse Maven插件[Run As]-[Maven build]時並未爲其指定goal或phase 
解決方法: 
在pom.xml中找到 <build> 節點,在裏面加上<defaultGoal>compile</defaultGoal>便可post

  • 緣由2:  使用Eclipse Maven插件[Run As]-[Maven build]時多輸入了mvn命令  ,由於Eclipse Maven插件已經幫你加上了mvn的命令前綴,再手動輸出mvn clean install之類的 命令就會變成mvn mvn clean install
相關文章
相關標籤/搜索