nexnus搭建maven私服配置导包

安装配置

  1. 下载安装包

     sudo wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.3.1-01-unix.tar.gz
    
  2. 安装运行

     tar zxvf nexus-3.3.1-01-unix.tar.gz 
     cd nexus-3.3.1-01/      
     nohup ./nexus run
    
  3. maven setting.xml配置

     <servers>
         <server>  
             <id>nexus</id>  
             <username>admin</username>  
             <password>admin123</password>  
         </server>  
     </servers>
    
  4. pom.xml配置

     <repositories>
             <repository>
                 <id>nexus</id>
                 <name>Team Nexus Repository</name>
                 <url>http://10.2.6.1:8081/repository/maven-public/</url>
             </repository>
         </repositories>
    
     <pluginRepositories>
         <pluginRepository>
             <id>nexus</id>
             <name>Team Nexus Repository</name>
             <url>http://10.2.6.1:8081/repository/maven-public/</url>
         </pluginRepository>
     </pluginRepositories>
     
    
  5. mvn deploy使用

     mvn deploy:deploy-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dfile=${path/*.jar} -Durl=http://10.2.6.1:8081/repository/thirdparty/ -DrepositoryId=nexus