在公司中同事将代码提交到私服,下载jar包后却看不到注释。 此时是因为同事没有将源码打包并上传到私服。配置方法如下:
<project>
<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.1</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>company releases repositories</name>
<url>http://mvnrepo.xxxx.com/mvn/releases</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>company releases repositories</name>
<url>http://mvnrepo.xxxx.com/mvn/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
|