2016-06-10 80 views
0

我想使用maven打包我的項目。我已經看過很多問題,但沒有人能夠幫助我,而且,我對此很是新手。當我嘗試執行命令「MVN清潔套裝」我的項目目錄中,我得到以下錯誤:無法使用Maven打包項目

[INFO] Scanning for projects... 
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.cognitionis:tipsem:jar:2.5 
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 48, column 21 
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. 
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects. 
[WARNING] 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building TIPSem 2.5 
[INFO] ------------------------------------------------------------------------ 
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.653s 
[INFO] Finished at: Sat Jun 11 00:29:54 IST 2016 
[INFO] Final Memory: 7M/102M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org refused: Connection refused -> [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] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException 

我已經安裝了Maven版本3.0.5,我已經包括在pom.xml中這個版本號好。你們能幫我解決這個問題嗎?

+2

你可以在瀏覽器中打開url http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom ?你有沒有無限制的互聯網連接? – dunni

+0

這看起來是「連接到http://repo.maven.apache.org拒絕:連接被拒絕」的原因 - 正如@dunni建議的那樣,請嘗試在瀏覽器中確認連接。你有連接到互聯網嗎?您的PC和互聯網之間是否有防火牆或代理? –

+0

是的。我確實有代理設置,但我可以在瀏覽器中打開該URL。 –

回答

0

如果您在任何組織中工作,他們通常限制在互聯網接入點/存儲庫,如果你是有任何的安全策略,

我建議你與其他人檢查你的組織是否有任何內部nexus或其他一些Maven倉庫已經存在,如果需要的話,你需要在.m2/settings.xml中配置倉庫。

如果不是@凱文胡克告訴檢查任何內部防火牆或代理設置。

+0

但我可以在我的瀏覽器中訪問URL。我有一個代理設置,但我不認爲這是原因。 –

+0

在您的瀏覽器中,代理/防火牆的配置已完成。 Maven中的代理配置必須在'settings.xml'中正確完成...... – khmarbaise