2016-09-29 52 views
-1

當我試圖在我的項目使用Maven,我得到了下面的錯誤建設:在pom.xml中出現錯誤。它顯示連接超時。我的網絡代理不允許連接到Maven的

CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.5.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.5.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:3.5.1 from/to central (https://repo.maven.apache.org/maven2): connect timed out

+0

可能重複的[Maven錯誤「無法傳輸...」](http://stackoverflow.com/questions/5074063/maven-error-failure-to-transfer) –

+0

你有這裏的答案http:///stackoverflow.com/questions/5074063/maven-error-failure-to-transfer –

回答

0

你的連接超時 - 請確保您連接到互聯網(例如,從命令行嘗試ping repo.maven.apache.org)。如果您位於代理服務器後面,則必須相應地添加配置(https://maven.apache.org/guides/mini/guide-proxies.html)。

確定您的互聯網連接正常工作後,您可以強制maven重新嘗試傳輸,方法是將-U標誌附加到您的命令中。

+0

我試過命令ping repo.maven.apache.org。它說請求超時。 – Nisha

+0

然後我建議你檢查你的網絡連接/代理設置。 – nutfox