nexus安装

一、依赖安装

1.上传程序包到/home下

2.配置Java环境

创建jdk目录

mkdir /mnt/java

解压程序包

tar -xvf /home/jdk-8u152-linux-x64.tar.gz -C /mnt/

修改环境变量

vi /etc/profile

#java
export JAVA_HOME=/mnt/java/jdk1.8.0_152/
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

source /etc/profile

验证jdk是否生效(如下则安装成功)

java -version

javaversion "1.8.0_152"
Java(TM)SE Runtime Environment (build 1.8.0_152-b16)
JavaHotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

3.配置maven

创建maven目录

mkdir /mnt/maven

解压程序包

unzip /home/apache-maven-3.5.0-bin.zip -d /mnt/maven/

修改环境变量

vi /etc/profile
添加:

#maven
export MAVEN_HOME=/mnt/maven/apache-maven-3.5.0
export PATH=${PATH}:${MAVEN_HOME}/bin

source /etc/profile

验证maven是否生效(如下则安装成功)

mvn -version

ApacheMaven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;2017-04-04T03:39:06+08:00)
Maven home: /mnt/maven/apache-maven-3.5.0
Java version: 1.8.0_152, vendor: OracleCorporation
Java home: /mnt/java/jdk1.8.0_152/jre
Defaultlocale: zh_CN, platform encoding: UTF-8
OS name:"linux", version: "3.10.0-862.el7.x86_64", arch:"amd64", family: "unix"

二、安装nexus

1.创建nexus目录

mkdir /mnt/nexus

2.解压程序包

tar -xvf /home/nexus-3.12.1-01-unix.tar.gz -C /mnt/nexus/

3.修改环境变量

vi /etc/profile

#nexus
export RUN_AS_USER=root

source /etc/profile

4.启动nexus

/mnt/nexus/nexus-3.12.1-01/bin/nexus start

5.查看日志

tail -f /mnt/nexus/sonatype-work/nexus3/log/nexus.log

6.登录nexus

http://ip:8081
用户名/密码(默认):admin/admin123

你可能感兴趣的:(nexus安装)