码迷,mamicode.com
首页 > 其他好文 > 详细

MAVEN 私有仓库库迁移

时间:2016-06-24 20:54:24      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:nexus   local   


一、下载 Nexus:


cd /usr/local/src


wget http://download.sonatype.com/nexus/oss/nexus-xxxx-bundle.tar.gz


二、安装配置授权 


cd /var/app/


sudo cp nexus-xxxx-bundle.tar.gz /var/app/


cd /var/app/


sudo tar xvzf nexus-xxxx-bundle.tar.gz


ln -s nexus-xxxx nexus


cp nexus/bin/nexus /etc/init.d/nexus


cd /etc/init.d


chmod 755 /etc/init.d/nexus



三、配置/etc/init.d/nexus:


vi /etc/init.d/nexus (修改如下变量)


示例:

# Set this to the root of the Nexus installation

NEXUS_HOME="/var/app/nexus-XXX"(不配置使用默认也可以)


# NOTE - This will set the user which is used to run the Wrapper as well as

#  the JVM and is not useful in situations where a privileged resource or

#  port needs to be allocated prior to the user being changed.

RUN_AS_USER=nexus (指定一个系统普通用户、启动使用普通用户启动)


示例:

配置/usr/local/nexus/conf/nexus.properties


vi /usr/local/nexus/conf/nexus.properties


示例:

# Jetty section

application-port=8081

application-host=0.0.0.0

nexus-webapp=${bundleBasedir}/nexus

nexus-webapp-context-path=/



# Nexus section

nexus-work=${bundleBasedir}/sonatype-work/nexus

runtime=${bundleBasedir}/nexus/WEB-INF



示例:

配置/var/app/nexus-xxxx权限


chown -R nexus:nexus /usr/local/nexus




备份仓库:将sonatype-work文件夹整体备份即可,也可以选择只备份最重要的两个文件夹索引(indexer)和仓库(storage)


还原仓库:将备份好的sonatype-work文件拷贝到新的服务器中。然后修改nexus/conf/nexus.properties配置文件,重新指定仓库的目录。


本文出自 “怀念技术支持” 博客,请务必保留此出处http://huainian.blog.51cto.com/2602707/1792571

MAVEN 私有仓库库迁移

标签:nexus   local   

原文地址:http://huainian.blog.51cto.com/2602707/1792571

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!