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

Posted

tags:

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

意思是没有指定此版本的目标。此句用了现在完成时态,表示过去的动作对现在产生了影响。

现在完成时有两种用法
1.过去发生的某一动作对现在造成的影响或结果或到现在为止已经发生或完成的动作。
2.表示过去发生的、持续到现在的动作或状态。

句型构成
基本结构:主语+have/has+动词的过去分词

现在完成时用法
①肯定句:主语+have/has+动词的过去分词(V-ed)+宾语(或者其他).

②否定句:主语+have not/has not+动词的过去分词(V-ed)+宾语.
③一般疑问句:Have/Has+主语+动词的过去分词(V-ed)+宾语(或者其他)?
④特殊疑问句:特殊疑问词+一般疑问句(have/has+主语+过去分词+其他)

重点词汇解释:
goal
n. 球门; 目标,目的; 终点; 得分;
[例句]David Seaman was back in the Arsenal goal after breaking a knuckle.
戴维·西曼在一个指关节骨折后又回到阿森纳队的球门前。

specify
vt. 指定; 详述; 提出…的条件; 使具有特性;
vi. 明确提出,详细说明;
[例句]They specified a spacious entrance hall.
他们专门指定要一个宽敞的大门厅。

build
vt. 建立; 建造,构筑; 开发; 为…建立基础;
vi. 建造,营造; 扩大,扩展; 发展,达到;
n. 体格,构造; 〈俚〉优美的体型,肉体美;
[例句]Developers are now proposing to build a hotel on the site.
开发商现在建议在这个地方盖一座宾馆。
参考技术A 一、
pom.xml文件<build>标签里面加上<defaultGoal>compile</defaultGoal>即可
二、
clean package -DskipTests
参考技术B mvn报错:No goals have been specified for this build

选择【Run As】-【Maven build】的时候,报:
[INFO] Scanning for projects…[INFO]
[INFO] BUILD FAILURE[INFO]
[INFO] Total time: 0.109s[INFO] Finished at: Wed Apr 13 11:04:20 CST 2011[INFO] Final Memory: 1M/4M[INFO]
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-site, site, post-site, site-deploy,
pre-clean, clean, post-clean. -> [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

eclipse安装的maven插件是m2eclipse,在控制台使用命令mvn compile并未报错。后在pom.xml文件<build>标签里面加 上<defaultGoal>compile</defaultGoal>即可。
其实使用命令行时就已经指定了phase,而使用m2eclipse的【Run As】-【Maven build】时并未为其指定goal或phase,所以才报这个错误。
参考技术C 你好!
No goals have been specified for this build
没有指定目标的构建
参考技术D tomcat7:run

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

Maven :No goals have been specified for this build

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(

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

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