新建的maven项目直接用maven编译报错

Posted loveyou1314

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了新建的maven项目直接用maven编译报错相关的知识,希望对你有一定的参考价值。

1.新建的maven项目直接编译的时候会报错:

 

[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]
[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/NoGoalSpecifiedException

 

解决方案:新需要在pom文件中加上:

 

<build>
<finalName>hotelManager-designnerWar</finalName>
<defaultGoal>compile</defaultGoal>

</build>

 


</build>










以上是关于新建的maven项目直接用maven编译报错的主要内容,如果未能解决你的问题,请参考以下文章

Intellij idea编译项目报错,项目里没有配maven,搞了好几天了,求大神帮忙。

maven第一次运行报错,求帮助

myeclipse创建maven项目后pom文件报错,

在idea中使用maven执行 `compile` 命令编译项目,发现报错:“找不到符号“。

Eclipse Maven项目报错1之JAVA编译版本报错

maven的pom文件报错怎么解决(eclipse环境)