1. 安装JAVA
#yum install java
#java -version
java version "1.7.0_101"
OpenJDK Runtime Environment (rhel-2.6.6.1.el7_2-x86_64 u101-b00)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
#yum install maven
2. 安装Maven
]# mvn -version
Apache Maven 3.0.5 (Red Hat 3.0.5-16)
Maven home: /usr/share/maven
Java version: 1.7.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.101-2.6.6.1.el7_2.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-229.el7.x86_64", arch: "amd64", family: "unix"
3.安装NEXUS
下载地址: http://www.sonatype.org/downloads
#tar zxvf nexus-latest-bundle.tar.gz
解压后会出现2个目录nexus-2.8.1-01和 sonatype-work
因为NEXUS不推荐使用root用户来启动,所以新建用户sonata,并把生成的2个目录的用户和组都改为sonata。
#mv nexus-2.8.1-01 nexus
#chown sonata:sonata -R nexus
#chown sonata:sonata -R sonatype-work
这样就可以启动nexus
# su sonata
$/opt/nexus/bin/nexus start
Starting Nexus OSS...
Started Nexus OSS.
也可以 添加Nexus为系统服务
#vi /usr/lib/systemd/system/nexus.service
[Unit]
Description=Nexus
Documentation=http://www.sonatype.org/nexus/resources/resources-book-links-and-downloads/
after=network.target
After=syslog.target
[Service]
User=sonata
Group=sonata
Type=forking
ExecStart=/opt/nexus/bin/nexus start
ExecReload=/opt/nexus/bin/nexus restart
ExecStop==/opt/nexus/bin/nexus stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
# chmod 644 nexus.service
# systemctl enable nexus.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nexus.service to /usr/lib/systemd/system/nexus.service.
#systemctl start nexus.service
4. 现在就可以从客户端访问nexus
http://192.135.9.23:8081/nexus/#welcome
登陆用户名和密码为:admin/admin123