频道栏目
首页 > 资讯 > 其他综合 > 正文

maven私有仓库nexus3.5搭建与使用

17-08-29        来源:[db:作者]  
收藏   我要投稿

maven私有仓库nexus3.5搭建与使用

环境

操作系统 ubuntu16.04 nexus版本 nexus-3.5.0-02-unix

下载

安装

$ sudo tar -zxvf nexus-3.5.0-02-unix.tar.gz -C /usr/local/
$ vim ~/.bashrc
添加
#for nexus
export NEXUS_HOME=/uusr/local/nexus-3.5.0-02
export PATH=$NEXUS_HOME/bin:$PATH
$ source ~/.bashrc
$ nexus start

打开浏览器url http://localhost:8081 用户名admin具有全部权限,默认密码admin123。

配置maven

在$MAVEN_HOME/conf下修改settings.xml

 
    org.sonatype.plugins
  

 
    
      nexus
      admin
      admin123
    
  


    
      nexus
      *
      http://localhost:8081/repository/maven-public/
    
  



      nexus
      
        
          central
          http://central
          true
          true
        
      
     
        
          central
          http://central
          true
          true
        
      
    

  
  
    nexus
  

使用maven编译会首先从nexus私有仓库中下载依赖包,如果nexus私有仓库没有,会从配置的mirror中maven官方中央仓库central中下载,同时存入到nexus私有仓库。

仓库迁移

nexus2.x 到nexus 2.x迁移
直接拷贝仓库目录进行迁移
当前机器上 ${user.home}/sonatype-work copy到新机器的对应位置。这样所有的数据就可以全部恢复。

nexus2.x 到nexus 3.x迁移

配置nexus-2.x的Upgrade #

Administration–>Capabilities–>New–>Upgrade: Agent–>Access Token–>12345678

上面的流程是登陆nexus-2.x配置Upgrade:Agent和Access Token在此我们配置的是12345678

配置nexus-3.x的Upgrade #

Administration–>System–>Capabilities–>Create capability–>Create Upgrade Capability

通过Task迁移数据 #

Administration–>System–>Upgrade–>Next–>URL&access token–>Next…

URL: nexus2.x的url
Access Token: 12345678

数据迁移完毕,验证仓库数据。

nexus3.x 到nexus 3.x迁移
暂时未找到方法,采用直接拷贝仓库目录进行迁移,maven编译时会有一些警告信息,并且有些包无法下载。

相关TAG标签
上一篇:python数据挖掘包matplotlib绘图
下一篇:python问题集
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站