Maven 尚未为此生成指定任何目标。

Maven 尚未为此生成指定任何目标。,maven,docker,Maven,Docker,我想让Maven在Docker工作 所以我从她那里提取了图像 但是,当我运行它时: 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>:<p

我想让Maven在Docker工作

所以我从她那里提取了图像

但是,当我运行它时:

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]
[ERROR]尚未为此生成指定任何目标。必须以以下格式指定有效的生命周期阶段或目标:或:[:]:。可用的生命周期阶段包括:验证、初始化、生成源、流程源、生成资源、流程资源、编译、流程类、生成测试源、流程测试源、生成测试资源、流程测试资源、测试编译、流程测试类、测试、准备包、包、预集成测试、,集成测试、集成后测试、验证、安装、部署、预清理、清理、清理后、预站点、站点、站点后、站点部署。->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
我没有Maven的经验,所以我不明白是什么导致了这个问题


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

你需要在点击
build as Maven

后在目标选项卡中定义
clean install
,或者运行类似于
surefire:test
等等,我不明白。代码中到底应该更改什么?您需要执行以下操作:`docher run maven clean`?检查这是否没有任何问题…什么是
单击构建
?也要避免用“u”代替“you”。这是一个专业网站,强烈反对使用俚语。@GoodbyeStackExchange,答案经过编辑以解决您提出的问题。
[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]