您的位置:首页 > 其它

maven打包jar上传到nexus

2017-03-28 00:00 369 查看
首先配置nexus



如果nexus返回400,那就是这里没配好

pom.xml增加节点:

<distributionManagement>
<repository>
<id>nexus-3rd</id>
<url>http://192.168.0.231:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</distributionManagement>

plugins增加节点上传源码包

<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>

在setting中设置:

<server>
<username>admin</username>
<password>123456</password>
<id>nexus-3rd</id>
</server>

最后执行, 意味跳过单元测试: -Dmaven.
test
.skip=
true


mvn deploy -Dmaven.
test
.skip=
true
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  nexus maven