centos7安装nexus3

1、下载nexus
wget https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/3/nexus-3.12.0-01-unix.tar.gz


2、解压
tar -zxvf nexus-3.12.0-01-unix.tar.gz -C /usr/local/nexus/


3、启动
cd /usr/local/nexus/nexus-3.12.0-01/bin
./nexus run &


看到“Started Sonatype Nexus OSS 3.12.0-01”启动成功
http://192.168.1.121:8081
默认端口:8081
默认用户名:admin
默认密码:admin123


4、设置开机自启动
vim /usr/lib/systemd/system/nexus.service


[Unit]
Description=nexus service


[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/usr/local/nexus/nexus-3.12.0-01/bin/nexus start
ExecReload=/usr/local/nexus/nexus-3.12.0-01/bin/nexus restart
ExecStop=/usr/local/nexus/nexus-3.12.0-01/bin/nexus stop
Restart=on-failure


[Install]
WantedBy=multi-user.target


服务加入开机启动 systemctl enable nexus.service
重新加载配置文件 systemctl daemon-reload


5、修改nexus用户root
vim bin/nexus.rc  =>  run_as_user="root"


6、修改jdk
vim bin/nexus  =>  INSTALL4J_JAVA_HOME_OVERRIDE=/usr/local/java/jdk1.8.0_91


7、修改默认端口
vim etc/nexus-default.properties  =>  application-port=8081


8、修改数据、日志存储位置
vim bin/nexus.vmoptions


9、nexus手动更新索引
从http://repo.maven.apache.org/maven2/.index/ 找到需要下载的索引文件,下面几个文件下载到同一目录
http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.gz
http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.properties
indexer-cli下载地址:http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.maven.indexer%22%20AND%20a%3A%22indexer-cli%22


执行
java -jar indexer-cli-6.0.0.jar -u nexus-maven-repository-index.gz -d indexer
等待程序运行完成之后可以发现indexer文件夹下出现了很多文件,将这些文件放置到{nexus-home}/sonatype-work/nexus3/indexer/central-ctx目录下
重新启动nexus

猜你喜欢

转载自blog.csdn.net/abcdad/article/details/80435978