2
我試圖在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如何拋出錯誤。
你需要定義你是否喜歡通過'package'或'deploy'等來運行生命週期,或者像'surefire:test'等運行插件的目標等。 – khmarbaise
我不明白。代碼中究竟應該改變什麼? – octavian
你需要做的是:'docher運行maven clean'?檢查這是否會沒有任何問題... – khmarbaise