Return code is: 401, ReasonPhrase: Unauthorized. ->
解决方法:
- 在maven的settings.xml 文件中 添加
<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
- 项目的pom文件添加:
<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.local.com/content/repositories/thirdparty</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.local.com/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
注意 pom文件的id 要和在 maven中配置的server的id 一致 否则不起作用
然后就deploy成功了
参考博客:
https://blog.csdn.net/a15835774652/article/details/80354602