尝试执行“mvn build”命令时,Maven出错

时间:2015-07-10 17:34:24

标签: maven

当我通过“run as”==>运行我的maven项目时在我的eclipse IDE中“Maven build”,img中显示的错误发生了。 ![在此输入图像说明] [1]

我的JDK版本是:1.7.0_76 Maven版本是:3.3.1 echo%JAVA_hOME%= D:\ work \ Java \ jdk1.7.0_76 echo%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

1 个答案:

答案 0 :(得分:0)

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