2016-12-21 37 views
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如何拋出錯誤。

+0

你需要定義你是否喜歡通過'package'或'deploy'等來運行生命週期,或者像'surefire:test'等運行插件的目標等。 – khmarbaise

+0

我不明白。代碼中究竟應該改變什麼? – octavian

+0

你需要做的是:'docher運行maven clean'?檢查這是否會沒有任何問題... – khmarbaise

回答

0

你需要在目標選項卡中定義'clean install'作爲maven後clicbuild。

+0

什麼是'clickbuild'?同時避免使用'你'代替'你'。這是一個專業的網站,俚語強烈不鼓勵。 – FrankerZ

相關問題