一、搭建maven 集成maven私服nexus

来源:互联网 发布:手机动态图加字软件 编辑:程序博客网 时间:2024/09/21 09:25

1.安装nexus

mkdir  /usr/local/nexus

tar -zxvf nexus-2.11-bundle.tar.gz -C /usr/local/nexus

2.配置nexus 

vim /usr/local/nexus/nexus-2.11.1-01/conf/nexus.properties

本处没有做修改

# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-webapp=${bundleBasedir}/nexus
nexus-webapp-context-path=/nexus
# Nexus section
nexus-work=${bundleBasedir}/../sonatype-work/nexus
runtime=${bundleBasedir}/nexus/WEB-INF

 3. vim /usr/local/nexus/nexus-2.11.1-01/bin/nexus

修改内容:
RUN_AS_USER=root

4.现在已经可以启动成功的了,现在我们来设置成为开机启动的服务。

centos 6设置开机启动

第一种:把nexus做成服务
  1、进入/etc/init.d目录命令:cd /etc/init.d
  2、拷贝nexus命令:cp /usr/local/nexus/nexus-2.11.1-01/bin/nexus ./nexus
  3、赋权命令:chmod 755 /etc/init.d/nexus
  4、添加服务命令:chkconfig --add nexus
  5、设置开机启动命令:chkconfig --levels 345 nexus on
  6、然后我们进行编辑/etc/init.d下的nexu文件命令:vim /etc/init.d/nexus
修改如下内容:
RUN_AS_USER=root
NEXUS_HOME="/usr/local/nexus/nexus-2.11.1-01"
PIDDIR="${NEXUS_HOME}"
  7、进行编辑nexus安装目录下的wrapper.conf文件命令:
vim /usr/local/nexus/nexus-2.11.1-01/bin/jsw/conf/wrapper.conf
注意修改jdk文件路径:wrapper.java.command=/usr/local/jdk1.7/bin/java
 8、最后我们执行:service nexus start (restart、stop)
 9、Reboot重启服务,开机时我们发现nexus服务自动已启动!



Centos7 设置开机启动服务 。

 前面几步骤相同:


配置系统启动 添加一个 nexus service 文件。

[html] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. vim /lib/systemd/system/nexus.service  

没配重启

[html] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. [Unit]  
  2. Description=nexus  
  3. After=network.target  
  4.   
  5. [Service]  
  6. Type=forking  
  7. ExecStart=/home/nexus-2.13.0-01/bin/nexus start  
  8. ExecReload=/home/nexus-2.13.0-01/bin/nexus restart  
  9. ExecStop=/home/nexus-2.13.0-01/bin/nexus stop  
  10. PrivateTmp=true  
  11.   
  12. [Install]    
  13. WantedBy=multi-user.target  


设置开机启动

[html] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. systemctl enable nexus.service    

service nexus start

安装maven 并集成nexus

进行maven的settings.xml配置

vim /usr/local/maven/conf/settings.xml

1.


2.配置nexus用户的权限


4.


5.active




0 0