Linux下搭建Nexus3私服仓库

ubuntu安装nexus-3.0.2-02
下载地址https://www.sonatype.com/download-oss-sonatype
参考资料http://www.cnblogs.com/qq27271609/p/5497815.html

安装

解压安装包

tar -xvf nexus-3.0.2-02-unix.tar.gz

root账户启动nexus需要设置环境变量RUN_AS_USER=root

export RUN_AS_USER=root

启动nexus

./bin/nexus start

浏览器输入http://ip:8081

用admin/admin123登录,开启部署策略

settings.xml



  C:\Users\Kosh\.m2\repository
    
        
          nexus
          admin
          admin123
        
    

    
        
          nexus
          http://139.196.8.178:8081/repository/maven-public/
          central
        
    

pom.xml


    
        nexus
        Nexus Release
        http://139.196.8.178:8081/repository/maven-releases/
    
    
        nexus
        Nexus Snapshot
        http://139.196.8.178:8081/repository/maven-snapshots/
    

发布第三方包

输入如下命令:

mvn deploy:deploy-file -DgroupId=log4j -DartifactId=log4j -Dversion=1.2.17 -Dpackaging=jar -DrepositoryId=3rdparty -Dfile=E:\IDEA\log4j-1.2.17.jar -Durl=http://localhost:8081/repository/3rdparty/ -DgeneratePom=false

其中groupId artifactId version 根据实际情况填写 repositoryId跟settings.xml中的保持一致
url在repository的设置当中可以看到

你可能感兴趣的:(Linux下搭建Nexus3私服仓库)