centos7搭建nexus maven私服
2017-07-25 00:00
387 查看
摘要: 对于很多企业来说,很多时候为了代码安全,他们需要特定的局域网内开发,这时候就需要搭建自己的maven仓库。当然拥有自己的maven仓库好处还有很多,比如减少内网下载jar速度、集中式管理jar包等。
这里我使用 wget 命令下载,操作路径 /data,如下
添加内容如下
最后使配置文件生效
以后台进程启动:./bin/nexus start
查看输出的日志:tail -f logs/wrapper.log
提示:
修改nexus安装目录bin/nexus.rc文件
重启防火墙:
nexus3.X的默认账号是:admin
nexus3.X的默认密码是:admin123
nexus3.X搭建的maven私服的本地访问地址是:http://私服的ip:8081**
例如我的就是:http://192.168.11.88:8081/
这里采用默认即可
更多详情,请关注我的博客https://highter.github.io
前提准备
jdk安装
参考CentOS安装JDKmaven安装
参考MAVEN安装(centos7)下载
下载地址:https://www.sonatype.com/download-oss-sonatype这里我使用 wget 命令下载,操作路径 /data,如下
[root@localhost data]# wget http://download.sonatype.com/nexus/3/latest-unix.tar.gz
安装配置
解压
[root@localhost data]# cp latest-unix.tar.gz /usr/local/ [root@localhost data]# cd /usr/local/ [root@localhost local]# tar -zxvf latest-unix.tar.gz
配置环境变量
[root@localhost local]# vim /etc/profile
添加内容如下
#set nexus export NEXUS_HOME=/usr/local/nexus-3.4.0-02 export PATH=$PATH:$NEXUS_HOME/bin
最后使配置文件生效
[root@localhost local]# vim /etc/profile
启动
前台启动:./bin/nexus console以后台进程启动:./bin/nexus start
查看输出的日志:tail -f logs/wrapper.log
[root@localhost local]# cd nexus-3.4.0-02/ [root@localhost nexus-3.4.0-02]# ./bin/nexus start
提示:
WARNING: ************************************************************ WARNING: Detected execution as "root" user. This is NOT recommended! WARNING: ************************************************************ Starting nexus
修改nexus安装目录bin/nexus.rc文件
[root@localhost nexus-3.4.0-02]# vim /usr/local/nexus-3.4.0-02/bin/nexus.rc #添加内容:run_as_user="root"
开启端口
开启端口:[root@localhost nexus-3.4.0-02]# firewall-cmd --zone=public --add-port=8081/tcp --permanent
重启防火墙:
[root@localhost nexus-3.4.0-02]# firewall-cmd --reload
访问私服
nexus3.X的默认端口是:8081nexus3.X的默认账号是:admin
nexus3.X的默认密码是:admin123
nexus3.X搭建的maven私服的本地访问地址是:http://私服的ip:8081**
例如我的就是:http://192.168.11.88:8081/
优化
设置开机自启动
[root@localhost nexus-3.4.0-02]# ln -s /usr/local/nexus-3.4.0-02/bin/nexus /etc/init.d/nexus3 [root@localhost nexus-3.4.0-02]# chkconfig --add nexus3 [root@localhost nexus-3.4.0-02]# chkconfig nexus3 on
修改运行nexus3所使用的用户
[root@localhost nexus-3.4.0-02]# vim /usr/local/nexus-3.4.0-02/bin/nexus.rc # 修改内容:run_as_user="root"
修改启动时jdk版本
[root@localhost nexus-3.4.0-02]# vim /usr/local/nexus-3.4.0-02/bin/nexus #修改内容:INSTALL4J_JAVA_HOME_OVERRIDE=/usr/local/java/jdk1.8.0_121
修改默认端口
[root@localhost nexus-3.4.0-02]# vim /usr/local/nexus-3.4.0-02/etc/nexus-default.properties #修改内容:application-port=8282
修改nexus3数据以及相关日志的存储位置:
[root@localhost etc]# vim /usr/local/nexus-3.4.0-02/bin/nexus.vmoptions
这里采用默认即可
-XX:LogFile=../sonatype-work/nexus3/log/jvm.log -Dkaraf.data=../sonatype-work/nexus3 -Djava.io.tmpdir=../sonatype-work/nexus3/tmp
启动命令
现在我们可以启动nexus3使用如下命令:[root@localhost nexus3]# /etc/init.d/nexus3 start
更多详情,请关注我的博客https://highter.github.io
相关文章推荐
- Centos7 搭建最新 Nexus3 Maven 私服
- linux(centos7)搭建maven nexus私服
- CentOS中用Nexus搭建maven私服,为Hadoop编译提供本地镜像
- 搭建nexus3版的maven私服(Centos7环境)
- Centos中nexus搭建maven私服
- 在操作系统Centos 6.3 上使用Nexus 2.8搭建MAVEN私服 及 cloudstack 开发环境
- 使用Nexus搭建Maven私服(centos7版)
- CentOS 6.5搭建Nexus Maven私服
- Centos搭建持续集成(六)----安装Maven以及nexus3私服
- CentOS 7安装Nexus,搭建Maven私服
- Centos 环境搭建之Maven私服nexus
- Centos7中搭建最新版nexus3_maven私服
- Centos 基础开发环境搭建之Maven私服nexus
- [置顶] 搭建nexus3版的maven私服(Centos7环境)
- Centos 基础开发环境搭建之Maven私服nexus
- Centos7 搭建最新 Nexus3 Maven 私服
- CentOS 6.5下搭建Maven私服nexus
- centos下 Maven 私服nexus 搭建教程
- 搭建nexus3版的maven私服(Centos7环境)
- Maven私服-Nexus搭建文档