使用 maven 发布, 并添加源码:
- 执行clean source:jar install -e -Dmaven.test.skip=true 打包源码并安装
- 执行 mvn install,maven会自动将source install到repository 。
- 执行 mvn deploy,maven会自动将source deploy到remote-repository 。
- 执行 mvn source:jar,单独打包源码。
pom.xml文件中添加
<build>
<plugins>
<!-- Source attach plugin -->
<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>
</plugins>
</build>
另一种写法
<build>
<plugins>
<plugin&