2014-10-06 139 views
0

在我的机器上的maven的设置'mvn.bat'没有正确执行。给出错误“没有为此构建指定目标......”。mvn.bat没有正确执行

JAVA_HOME设置正常。 尽管'mvn --version'没有错误。

回答

1

其实,这个错误是不言自明:

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. 

您还没有指定任何目标。你必须。很可能你想要mvn installmvn clean install。我建议您阅读Maven的使用和示例。

+0

但是,运行mvn.bat是否也需要目标? – grd 2014-10-06 12:28:06

+1

正如你在错误中所看到的那样,没有任何东西像纯粹运行它一样。如果在你的问题中描述了你想要完成的事情,可能会更容易,因为运行mvn.bat似乎不是你想要的。 – Deltharis 2014-10-06 12:35:07