![](/img/trans.png)
[英]maven getting “Not Authorized” when trying to access nexus private repository
[英]Maven Nexus private repository access
我剛在本地網絡中建立了一個nexus存儲庫。 此存儲庫公開了對Maven中央存儲庫的訪問,以及三個不同的私有托管存儲庫: snapshot , release和ext3rdparty 。 所有這些存儲庫都是nexus中公共組的一部分,我將其用作所有存儲庫的中央訪問點:
HTTP://nexus.server/nexus/content/groups/public/
我的問題是 :使用NetBeans作為開發環境,我可以訪問除 ext3rdparty 之外的所有存儲庫。 即當我嘗試構建基於存儲在ext3rdparty repo中的庫的項目時,我收到了編譯錯誤,並且NetBeans無法找到/導航此存儲庫中可用的任何工件。
我懷疑這是一個settings.xml / pom.xml問題而不是NetBeans問題,因為正如我所說,我可以訪問我在其他存儲庫中發布的工件,但我無法弄清楚問題是什么。
以下是我的settings.xml的完整內容,用於將maven重定向到我自己的存儲庫:
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://nexus.server/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
<servers>
<server>
<id>nexus</id>
<username>user</username>
<password>***</password>
</server>
<server>
<id>releases</id>
<username>user</username>
<password>***</password>
</server>
<server>
<id>snapshots</id>
<username>user</username>
<password>***</password>
</server>
</servers>
以下是我的父pom中與存儲庫相關的部分,以允許部署:
<distributionManagement>
<repository>
<id>releases</id>
<name>Releases</name>
<url>http://nexus.server/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshots</name>
<url>http://nexus.server/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
什么是錯的?
提前致謝!
編輯 :
半天失去了:我終於最終從ext3rdparty存儲庫中刪除了所有依賴項,再次將它們上傳到存儲庫,並更新所有索引,現在一切正常......
不知道這里有什么問題,但至少pom和設置都沒關系。 謝謝你的幫助。
您是否已將ext3rdparty回購添加到公共組?
如果您遇到此類問題,可以右鍵單擊“存儲庫”列表中受影響的存儲庫,然后激活“修復索引”或“更新索引”,然后在“系統源”中查看系統更新中的狀態。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.