笔记:Maven启动报错 - No goals have been specified for this build.You must specify a valid lifecycle phase

约定不等于承诺〃 2022-05-14 15:26 639阅读 0赞

Maven启动报错:

  1. [ERROR] 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-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]
  2. [ERROR]
  3. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  4. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  5. [ERROR]
  6. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  7. [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException

解决办法:
在pom.xml配置增加

  1. <build>
  2. <defaultGoal>compile</defaultGoal>
  3. </build>

发表评论

表情:
评论列表 (有 0 条评论,639人围观)

还没有评论,来说两句吧...

相关阅读