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 对应的值保持一致

 

相关文章:

  • 2021-12-06
  • 2022-01-02
  • 2021-10-08
  • 2022-01-22
  • 2021-07-28
  • 2021-08-24
猜你喜欢
  • 2021-07-25
  • 2021-04-20
  • 2021-11-24
  • 2021-06-01
  • 2021-09-07
  • 2022-03-04
相关资源
相似解决方案