1、配置setting.xml
<server>
<id>maven-snapshots</id>
<username>admin</username>
<password>111111111111</password>
</server>
<server>
<id>maven-release</id>
<username>admin</username>
<password>111111111111</password>
</server>
2、配置pom.xml ,id要一致
<distributionManagement>
<repository>
<id>maven-release</id>
<name>Nexus Release Repository</name>
<url>http://192.168.3.17/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://192.168.3.17/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
3、发布
mvn deploy
来源:oschina
链接:https://my.oschina.net/internetafei/blog/4300529