maven打包jar上传到nexus

首先配置nexusapache

若是nexus返回400,那就是这里没配好maven

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中设置:url

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

 

 

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

mvn deploy -Dmaven.test.skip=trueserver

相关文章
相关标签/搜索