Maven上传Nexus私服带源码

maven-source-plugin插件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

settings.xml配置验证信息

1
2
3
4
5
6
7
8
9
<settings>
<servers>
<server>
<id>id</id>
<username>username</username>
<password>password</password>
</server>
</servers>
</settings>

pom.xml中的id要和settings.xml中的一致

1
2
3
4
5
6
<distributionManagement>
<repository>
<id>id</id>
<url>url</url>
</repository>
</distributionManagement>