maven deploy配置
项目配置发布私服地址(一般如果项目只需要发布到一个私服可以配置到项目顶层pom文件中)
<!-- 发布配置 -->
<distributionManagement>
<repository>
<id>releases</id>
<url>http://localhost:8080/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<uniqueVersion>false</uniqueVersion>
<url>http://localhost:8080/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
项目配置源码发布
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
项目配置模块跳过发布(一个项目不是所有模块都需要发布到私服)
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
本地maven setting文件配置账号(不然会没权限)
<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>admin</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>