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

Posted Twinhead

tags:

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

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]  

解决方案:

pom.xml文件加入  <build><defaultGoal>compile</defaultGoal></build>即可  

 

 

maven建立镜像仓库

<mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>       
    </mirror>

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

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

Maven :No goals have been specified for this build

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

No goals have been specified for this build. You

启动maven服务时 出现No goals have been specified for this build. You must specify a valid lifecycle phase o

No goals have been specified for this build怎么解决