CentOS 7 使用Nexus3搭建maven私服

安装jdk(略)

安装maven

wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz

tar -zxf apache-maven-3.5.4-bin.tar.gz 

添加环境变量

vim /etc/profile

在文件下方添加如下内容(这里的MAVEN_HOME需要改为你自己的maven解压目录):

export MAVEN_HOME="/opt/apache-maven-3.5.4"
export PATH="$MAVEN_HOME/bin:$PATH"

安装nexus

在这里下载
https://www.sonatype.com/download-oss-sonatype

wget https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/3/nexus-3.13.0-01-unix.tar.gz
tar -zxf nexus-3.13.0-01-unix.tar.gz
 cd nexus-3.13.0-01/bin/
./nexus start

注意: 出现了root用户不建议的警告,解决方法如下

run_as_user="root"

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

点击右上角的sign in登录,输入账户admin,密码admin123即可登录成功。

 常用命令

./nexus run命令行输出 前台进程 可以使用Ctril+c停止Nexus
./nexus start: 在后台启动Nexus服务
./nexus stop: 停止后台的Nexus服务
./nexus status : 查看后台Nexus服务状态
./nexus restart: 重新启动后台的Nexus服务

配置
修改nexus-3.13.0-01/etc/nexus-default.properties配置文件中的

application-port=8081

FAQ
提示System Requirement: max file descriptors [4096] likely too low, increase to at least [65536].

vim /etc/security/limits.conf

* soft nofile 65536
* hard nofile 65536

然后重启

./nexus restart

如果你创建了nexus用户 就用nexus替代root 我这里为了方便 就没有专门建nexus用户

有问题可以查查官方文档
https://help.sonatype.com/docs

猜你喜欢

转载自www.cnblogs.com/aqicheng/p/11394151.html
今日推荐