【问题标题】:No goals have been specified for this build.没有为此构建指定目标。
【发布时间】:2017-05-06 19:35:33
【问题描述】:

我正在尝试在 Docker 中运行 Maven。

所以我从她https://hub.docker.com/_/maven/ 那里提取了图片。

docker pull maven

但是,当我运行它时:

docker run maven

我明白了:

[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]

我没有使用 Maven 的经验,所以我不明白是什么导致了这个问题。

Docker 容器只安装了 Maven,但它没有运行它,所以我不明白 Maven 是如何抛出错误的。

【问题讨论】:

  • 您需要定义您是喜欢通过packagedeploy 等运行生命周期,还是运行surefire:test 等插件的目标。
  • 我不明白。代码中究竟应该改变什么?
  • 你需要做:`docher run maven clean`?检查这是否没有任何问题...

标签: maven docker


【解决方案1】:

点击build as maven后,您需要在目标选项卡中定义clean install

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多