運行Maven是報錯:No goals have been specified for this build .

 

運行Maven的時候, pom.xml --> Run As --> Maven build    時報錯如下,
Java代碼  收藏代碼
  1. No goals have been specified for this build. 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-packagepackage, 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]  
 
 
解決辦法代碼  收藏代碼
  1. pom.xml文件<build>標籤裏面加上<defaultGoal>compile</defaultGoal>即可  
  2. <build>
       <defaultGoal>compile</defaultGoal>
      </build>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章