日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

搭建Nexus私服实现本地拉取依赖包

發布時間:2023/12/13 综合教程 26 生活家
生活随笔 收集整理的這篇文章主要介紹了 搭建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私服实现本地拉取依赖包的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。