mvn release:perform Return code is: 401, ReasonPhrase: Unauthorized.
程序员文章站
2022-04-04 17:18:33
...
mvn:release:perform时
会先读$MAVEN_HOME/conf/setting.xml
再读$USER_HOME/.m2/setting.xml
$USER_HOME/.m2/setting.xml会覆盖$MAVEN_HOME/conf/setting.xml
且需注意pom.xml里的
<!-- mvn deploy时发布项目到仓库 --> <distributionManagement> <snapshotRepository> <id>snapshots</id> <url>http://172.16.0.205:8081/nexus/content/repositories/snapshots/</url> <!-- 不会生成多个含时间戳的版本 --> <uniqueVersion>false</uniqueVersion> </snapshotRepository> <repository> <id>releases</id> <url>http://172.16.0.205:8081/nexus/content/repositories/releases/</url> </repository> </distributionManagement>
snapshotRepository 与 repository的id
需与setting.xml里的server的id一致
<servers> <server> <id>releases</id> <username>admin</username> <password>xxxxxxx</password> </server> <server> <id>thirdpart</id> <username>admin</username> <password>xxxxxxx</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>xxxxxxx</password> </server> </servers>
上一篇: spring mvc 参数注入说明
下一篇: JAVA远程调试