2015-07-10 180 views
0

当我在eclipse IDE中通过“run as”==>“Maven build”运行我的maven项目时,发生了什么,显示在img下面。 ! [在这里输入的形象描述] [1]Maven在尝试执行“mvn build”命令时出现错误

我的JDK版本:1.7.0_76 Maven的版本是:3.3.1 回声%JAVA_HOME%= d:\工作\的Java \ jdk1.7.0_76 回声%M2_HOME%= D:\ work \ apache-maven-3.3.3 在我的Eclipse IDE中我的maven设置类似于img:![在这里输入图片描述] [2]![3]

我的项目的构建路径![在这里输入的形象描述] [4]

这是因为这个项目是JDK1.6编译的老项目,所以,我选择安装的JDK1.6。但是当作为maven构建运行时,像图片1这样的错误发生了!

帮帮我吧!

The error is 【[INFO] Scanning for projects... 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.084 s 
[INFO] Finished at: 2015-07-11T01:15:18+08:00 
[INFO] Final Memory: 5M/154M 
[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-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 

回答

0

如果选择运行方式Maven构建一个Eclipse 运行配置使用(见菜单运行运行配置...)。在Maven Build的情况下,必须在其目标:字段中指定至少一个适当的目标(例如,Maven's built-in lifecycles之一)。

相关问题