【问题标题】:Trigger Maven Build from Eclipse Build从 Eclipse 构建触发 Maven 构建
【发布时间】:2013-05-24 12:17:10
【问题描述】:

我有一个基于 Maven 的 Spring MVC 项目。当我右键单击任何项​​目并单击“构建项目”时,我希望能够触发 Maven 构建。到目前为止,什么也没有发生。但是,如果我右键单击一个项目并单击 Run As...>Maven Build 并提供目标“包”,它会触发 Maven 构建。

当我单击构建项目时,是什么阻止了它运行 Maven 构建。

【问题讨论】:

    标签: eclipse maven spring-mvc build


    【解决方案1】:

    这只是意味着 maven 不知道你想要它做什么。在不指定目标的情况下运行 maven 构建,就像从命令行运行 mvn 一样。这会给你一个错误。

    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.263s
    [INFO] Finished at: Wed May 29 15:33:36 CAT 2013
    [INFO] Final Memory: 2M/76M
    [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
    

    注意这行,您必须指定有效的生命周期阶段或目标

    有关更多说明,请参阅错误消息底部的链接。此外,您可能想从 maven 网站阅读此 page

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-03
      • 2018-01-04
      • 1970-01-01
      • 1970-01-01
      • 2022-12-16
      • 1970-01-01
      • 1970-01-01
      • 2014-10-19
      相关资源
      最近更新 更多