Nexus

Nexus是什么

Nexus 是 Sonatype 公司发布的一款仓库(Repository)管理软件,常用来搭建 Maven 私服,所以也有人将 Nexus 称为“Maven仓库管理器”

下载

官网下载:https://help.sonatype.com/repomanager3/product-information/download

安装
1.1 安装
1) 在home/nexus目录下创建nexus安装目录:

cd /home/nexus
mkdir nexus
2) 将资源放在nexus文件下

3) 解压nexus文件

tar zxvf nexus-3.58.0-01-unix.tar.gz
4) 配置 nexus 环境变量

打开 etc/ 目录下的 profile 文件,命令如下

vim /etc/profile
把 nuxus 环境添加到 profile 尾部,环境代码如下

# nexus
export MAVEN_HOME=/home/nexus/nexus-3.58.0-01
export PATH=$PATH:$MAVEN_HOME/bin
注:/home/nexus/nexus-3.58.0-01 为nexus的安装路径

5) 重新加载配置文件,让配置生效

让配置生效
source profile /etc/profile

 启动 nexus


1) 进入 nexus 根目录下的 bin (/home/nexus/nexus-3.58.0-01/bin )目录,启动 nexus 服务

nexus start

错误:

WARNING: ************************************************************
WARNING: Detected execution as "root" user.  This is NOT recommended!
WARNING: ************************************************************
Starting nexus

解决:

找到home/nexus/nexus-3.58.0-01/bin 下nexus文件,vi编辑,将run_as_root=true改为run_as_root=false,再次启动就可以了
 


2) 更改端口

nexus 默认端口是 8081 , 如果我们的端口被占用了,则需要重新为 nexus 指定端口,端口的配置文件在安装目录下的 etc 目录
进入 etc 目录,找到 nexus-default.properties 文件
用 vim 打开 nexus-default.properties 文件

# Jetty section
application-port=8081
application-host=0.0.0.0
改为

# Jetty section
application-port=8085
application-host=0.0.0.0
这样我们就把 nexus 的端口从 8081 改为 8085 , 还需要重启 nexus服务

# 重启服务
nexus restart
3) 开启端口

# 开启8085端口
firewall-cmd --zone=public --add-port=8085/tcp --permanent
 
# 重启
firewall-cmd --reload

3)查看状态

[root@had2 bin]# ./nexus status
nexus is running.

访问:http://127.0.0.1:8081/#browse/browse

Nexus_第1张图片

nexus登录

Nexus_第2张图片

默认 帐号  admin 密码 admin123 ,期实  默认 密码 admin123 不对

报错:

登入时报:incorrect username or password,or no permission to use application

解决:vi /home/nexus/sonatype-work/nexus3/admin.password

a0db25f2-b245-47bb-9e8a-cc241012bfb6 (默认 密码)

你可能感兴趣的:(linux,运维,服务器,maven)