1. 最外层 pom.xml 中增加
<distributionManagement>
<repository>
<id>xxxxx-dev</id>
<name>Nexus Release Repository</name>
<url>http://xxxxxxxxxxxxx:8081/nexus/content/repositories/xxxx/</url>
</repository>
<snapshotRepository>
<id>xxxxx-dev</id>
<name>Nexus Snapshot Repository</name>
<url>http://xxxxxxxx:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
2. 检查maven的setting.xml 中文件是否有以下配置,如果有,跳过。
<server>
<id>xxxxx-dev</id>
<username>deployment</username>
<password>deployment123</password>
</server>
3. maven命令发布到私服:
mvn clean deploy