搭建Nexus私服实现本地拉取依赖包
生活随笔
收集整理的這篇文章主要介紹了
搭建Nexus私服实现本地拉取依赖包
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
搭建Nexus私服實現本地拉取依賴包
轉載于https://dbawsp.com/1439.html
安裝JDK與Nexus環境:
修改主機名:
hostnamectl set-hostname nexus
bash
網站內搜索:
jdk-8u181-linux-x64.rpm
mkdir /home/tools && cd /home/tools
點擊下載JDK環境RPM包
rpm -ivh jdk-8u181-linux-x64.rpm
下載Nexus程序:
點擊下載Nexus程序包
部署并啟動Nexus程序:
tar xf nexus-3.13.0-01-unix.tar.gz
mv nexus-3.13.0-01 /usr/local/nexus
cd /usr/local/nexus/bin/
./nexus start
Nexus會把所有磁盤當成存儲空間,硬盤越大,啟動越慢
查看Nexus端口:
netstat -tunpl|grep '8081'
界面操作Nexus:
用戶:admin
密碼:admin123
配置Maven全局配置:
cd /usr/local/maven/conf/ && vim settings.xml
找到標簽,添加 Nexus 默認認證信息:(132行下)
<server>
<id>my-nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>my-nexus-snapshot</id>
<username>admin</username>
<password>admin123</password>
</server>
找到標簽,在修改server標簽后添加鏡像:(168行下)
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://10.0.0.80:8081/repository/maven-public/</url>
</mirror>
找到標簽,在修改mirrir標簽后添加倉庫信息:(262行下)
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://10.0.0.80:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://10.0.0.80:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
激活倉庫:(293行下)
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
上傳并解壓jeesns源碼包:
cd /tmp/ && tar xf jeesns.tar.gz && cd jeesns/
編譯源碼包:
rm -rf /root/.m2/
mvn clean package
總結
以上是生活随笔為你收集整理的搭建Nexus私服实现本地拉取依赖包的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LIS路径记录(UVA481)
- 下一篇: activiti 视图