我想使用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中這個版本號好。你們能幫我解決這個問題嗎?
你可以在瀏覽器中打開url http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom ?你有沒有無限制的互聯網連接? – dunni
這看起來是「連接到http://repo.maven.apache.org拒絕:連接被拒絕」的原因 - 正如@dunni建議的那樣,請嘗試在瀏覽器中確認連接。你有連接到互聯網嗎?您的PC和互聯網之間是否有防火牆或代理? –
是的。我確實有代理設置,但我可以在瀏覽器中打開該URL。 –