天天看点

CentOS安装nexus(Maven仓库管理器)

我的准备:

注:最终启动,如果远程访问关闭,或者是stoped的nexus的jre版本和本地jre的version不符合(一般1.7就ok)!

1:解压:

注:安装nexus,本地仓库默认的jar包存储位置是:/sonatype-work/nexus/storage/central。由于central仓库占用存储较大,所以要注意存储位置。

2:移动合适位置/home/nexus:

3:修改配置文件1:/home/nexus/nexus-2.11.1-01/conf/nexus.properties

4:修改配置文件2:/home/nexus/nexus-2.11.1-01/bin/nexus

注:nexus很依赖于jdk,编写,所以必须安装好jdk并设置环境变量/etc/profile并生效!备注附件!

5:启动nexus服务:

警告:不推荐作为root用户运行.

6:nexus启动日志:

注:启动日志:*system org.sonatype.nexus.bootstrap.jetty.jettyserver - started则,启动成功!

用浏览器访问:http://192.168.10.56:8081/nexus/

CentOS安装nexus(Maven仓库管理器)

7:nexus开机启动:

问题1:

[root@centos-slave1 bin]# ./nexus start

****************************************

warning - not recommended to run as root

if you insist running as root, then set the environment variable run_as_user=root before running this script.

解决1:上:4:修改配置文件2:/home/nexus/nexus-2.11.1-01/bin/nexus ---> run_as_user=root

备注附件:

安装jdk:

参数说明:

maven的pom.xml设置: