的項目我的POM文件有以下分配管理標籤的Maven找不到依賴於的Nexus
<distributionManagement>
<repository>
<id>confiz-repo</id>
<url>http://10.10.10.230:8081/nexus/content/repositories/snapshots/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</distributionManagement>
我用MVN部署,並且給了我成功了。所以我知道我的神器已經部署成功。現在我的settings.xml文件如下
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>confiz-repo</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<!-- The id of this mirror and the server instance above needs to be the same!-->
<id>confiz-repo</id>
<mirrorOf>*</mirrorOf>
<url> http://10.10.10.230:8081/nexus/content/groups/public/</url>
</mirror>
<mirror>
<!-- The id of this mirror and the server instance above needs to be the same!-->
<id>confiz-repo</id>
<mirrorOf>*</mirrorOf>
<url> http://10.10.10.230:8081/nexus/content/repositories/snapshots/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>confiz-repo</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>confiz-repo</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
現在,當我加入的第一個項目的依賴關係到我的第二個項目,運行mvn乾淨安裝Maven抱怨
[ERROR] Failed to execute goal on project merchant: Could not resolve dependencies for project com.onestopspot:merchant:apk:1.0.1-SNAPSHOT: Could not find artifact com.confiz.abc:my-artifact:jar:1.0-SNAPSHOT in confiz-repo (http://10.10.10.230:8081/nexus/content/groups/public/) -> [Help 1]
我到底做錯了什麼?
編輯 - 我可以看到我的工件部署在nexus中。所以我正確地說mvn部署工作正常。但是nexus嘗試讀取的路徑http://10.10.10.230:8081/nexus/content/groups/public/
不包含我的工件。
只是一個猜測:嘗試第一次:清理安裝在必須部署的項目上。其次(安裝後),部署它 – dantuch
「所以我知道我的神器已經部署成功」 - 不,你不知道。使用瀏覽器轉到Nexus並在http://10.10.10.230:8081/nexus/content/repositories/snapshots/下查找您的工件 - 如果它不在那裏,您知道您沒有真正獲得成功的部署,所以你需要在Maven輸出的時候用Maven的輸出來更新你的問題。 – parsifal
如果你在那裏看到你的groups/public存儲庫是錯誤配置的。不過,它應該引用你的快照庫,所以我敢打賭你沒有正確部署。 – parsifal