2017-02-17 61 views
1

Teamcity doc無法以行家

我用mvn archetype:generate -DarchetypeRepository=http://download.jetbrains.com/teamcity-repository -DarchetypeArtifactId=teamcity-server-plugin -DarchetypeGroupId=org.jetbrains.teamcity.archetypes -DarchetypeVersion=RELEASE創建服務器端只插件的項目模板獲取服務器原型根據指令。

但是,每次執行mvn命令時,錯誤都將如下所示。

[INFO] Scanning for projects... 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Maven Stub Project (No POM) 1 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] >>> maven-archetype-plugin:3.0.0:generate (default-cli) > generate-source 
s @ standalone-pom >>> 
[INFO] 
[INFO] <<< maven-archetype-plugin:3.0.0:generate (default-cli) < generate-source 
s @ standalone-pom <<< 
[INFO] 
[INFO] --- maven-archetype-plugin:3.0.0:generate (default-cli) @ standalone-pom 
--- 
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/1.8 
.3/groovy-1.8.3.jar 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 20:12 min 
[INFO] Finished at: 2017-02-17T10:16:15+08:00 
[INFO] Final Memory: 9M/21M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3 
.0.0:generate (default-cli) on project standalone-pom: Execution default-cli of 
goal org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate failed: Plug 
in org.apache.maven.plugins:maven-archetype-plugin:3.0.0 or one of its dependenc 
ies could not be resolved: Could not transfer artifact org.codehaus.groovy:groov 
y:jar:1.8.3 from/to central (https://repo.maven.apache.org/maven2): GET request 
of: org/codehaus/groovy/groovy/1.8.3/groovy-1.8.3.jar from central failed: Prema 
ture end of Content-Length delimited message body (expected: 5522507; received: 
3244032 -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit 
ch. 
[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 rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti 
onException 

任何人都知道如何解決這個問題?

+0

你有你的結束某種互聯網/代理問題的問題。它在這裏正常運行。 –

+0

@JorgeCampos謝謝豪爾赫,下載過程不會立即停止,但可以中途下載。除此之外,我已經在.m2文件夾中設置了代理。 – Gearon

+0

@JorgeCampos你能告訴我你使用的Maven版本嗎?謝謝 – Gearon

回答

2

修改鏡子setttings.xml將修復

<mirrors> 
    <mirror> 
    <id>google-maven-central</id> 
    <name>Google Maven Central</name> 
    <url>https://maven-central.storage.googleapis.com</url> 
    <mirrorOf>central</mirrorOf> 
    </mirror> 
</mirrors> 

請把上面的部分Settings.XML中

+0

這對我有效,謝謝。將有興趣瞭解爲什麼這是必需的工作。以及它如何解決「[錯誤]無法執行目標org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate」 –