maven從遠程倉庫下載jar偶爾會有一些jar會沒有,可通過其他渠道下載後手動上傳至nexus私服,本地開發maven settings文件中配置使用私服,需要從其他倉庫下載可將其他倉庫配置進私服的public倉庫組
1.下載
$ wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.6.0-02-unix.tar.gz
2.解壓
tar -zxvf nexus-3.6.0-02-unix.tar.gz
3.修改nexus訪問端口
$ vi nexus-3.6.0-02/etc/nexus-default.properties
application-port=18081
4.啓動
$ ./nexus-3.6.0-02/bin/nexus start
5.訪問http://47.96.28.236:18081/nexus/
若不能訪問,登錄阿里雲開放端口18081或者使用nginx代理
6.登錄
- 默認賬號admin
- 默認密碼admin123
7.配置nexus環境變量,便於直接執行nexus啓動和停止
$ vi /etc/profile
#添加如下
export NEXUS_HOME=/home/env-package/nexus/nexus-2.11.2-03/
export PATH=$NEXUS_HOME/bin:$PATH
8.讓環境變量立即生效
$ source /etc/profile
9.目前只能使用ip:18081/nexus訪問,但阿里雲默認不開放其他端口,因此使用nginx代理下
$ vi /usr/local/nginx/conf/nginx.conf
#添加如下:
location /nexus {
proxy_pass http://localhost:18081/nexus;
}
10.nginx重新加載
$ nginx -s reload
11.訪問域名www.aikafka.com/nexus即可通過外網訪問無需開放其他端口