mvn -deploy 報錯Failed to deploy artifacts: Could not find artifact

問題報錯:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project apollo: Failed to deploy artifacts: Could not find artifact com.ctrip.framework.apollo
:apollo:pom:0.8.0 in releases (http://ip:8081/nexus/content/repositories/) -> [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/MojoExecutionException

問題分析:從報錯看無法找到apollo:pom:0.8.0 這個pom文件, 但是從私服Nexus上看releases倉Repository Path 的地址爲
http://ip:8081/nexus/content/repositories/
於是想到路徑可能不對,查找maven的setting.xml,發現裏面有配置路徑:

<properties>
    <releases.repo>http://ip:8081/nexus/content/repositories/</releases.repo>
    <snapshots.repo>http://ip:8081/nexus/content/repositories/</snapshots.repo>
</properties>

問題解決:
這個路徑是公司其他同事配置好的,這個路徑剛好與報錯信息中的路徑一致,路徑與私服上這兩個倉庫的路徑不一樣,隨修改之,

<properties>
    <releases.repo>http://ip:8081/nexus/content/repositories/releases/</releases.repo>
    <snapshots.repo>http://ip:8081/nexus/content/repositories/snapshots/</snapshots.repo>
</properties>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章