Nexus 私服下載 jar 顯示 Not authorized


1、具體報錯信息如下

Could not transfer artifact org.apache.curator:curator-recipes:pom:2.11.0 from/to nexus 
(http://192.168.198.128:8081/repository/maven-public/): Not authorized

 

2、原因:在 settings.xml 的 mirrors 標簽只配置了私服的鏡像,而沒有在 servers 標簽中配置對應的用戶名和密碼

<mirror>
	<id>nexus</id>
	<name>Nexus private</name>
	<mirrorOf>*</mirrorOf>
	<url>http://192.168.198.128:8081/repository/maven-public/</url>
</mirror>

 

3、解決方案:在 settings.xml 的 servers 標簽中添加如下配置

<server>
  <id>nexus</id>
  <username>admin</privateKey>
  <password>admin123</passphrase>
</server>

注意:mirror 標簽內的 id 和 servier 標簽內的 id 對應的值保持一致

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM