- 配置发布目标远程仓库
<distributionManagement>
<repository>
<id>nexus-release</id>
<url>http://xxxxxx/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshot</id>
<url>http://xxxx/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
- 配置发布源代码插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
- 执行发布命令
mvn clean deploy
网友评论