运行Maven工程总是报错:No goals have been specified for this build

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了运行Maven工程总是报错:No goals have been specified for this build相关的知识,希望对你有一定的参考价值。

 Error info:

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]

解决办法:在build后面加上<defaultGoal>compile</defaultGoal>

 

以上是关于运行Maven工程总是报错:No goals have been specified for this build的主要内容,如果未能解决你的问题,请参考以下文章

idea创建Maven 项目后,底部没有run窗口 且运行后报错No goals have been specified for this build.

Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle(

Maven :No goals have been specified for this build

No goals have been specified for this build. You

jenkins运行报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (defau

maven项目test报错Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin