欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

maven私服的配置使用方法

 更新時(shí)間:2020年08月28日 10:50:11   作者:經(jīng)典雞翅  
這篇文章主要介紹了maven私服的配置使用方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

maven的倉庫分為本地倉庫,遠(yuǎn)程倉庫和私服倉庫。

私服倉庫一般是公司內(nèi)部私有的,內(nèi)部進(jìn)行維護(hù)的。公司員工連接私服,從私服中下載jar,或者將自身的jar傳到私服上。私服還可以從中央倉庫下載jar,當(dāng)私服中沒用jar的時(shí)候,就會(huì)從中央倉庫下載。

搭建私服下載

下載 Nexus,下載地址:http://www.sonatype.org/nexus/archived/ 。

可以選擇zip和tar,分別對(duì)應(yīng)windows和linux。

安裝

將下載的zip解壓,使用cmd進(jìn)入bin目錄,執(zhí)行命令:

nexus.bat install

卸載

執(zhí)行命令:

nexus.bat uninstall

啟動(dòng)

1、cmd進(jìn)入目錄,執(zhí)行命令

nexus.bat start

2、在服務(wù)中找到nexus,右鍵啟動(dòng)

nexus配置文件詳細(xì)

查看 nexus 的配置文件conf/nexus.properties
application-port=8081 # nexus 的訪問端口配置
application-host=0.0.0.0 # nexus 主機(jī)監(jiān)聽配置(不用修改)
nexus-webapp=${bundleBasedir}/nexus # nexus 工程目錄
nexus-webapp-context-path=/nexus # nexus 的 web 訪問路徑
nexus-work=${bundleBasedir}/../sonatype-work/nexus # nexus 倉庫目錄
runtime=${bundleBasedir}/nexus/WEB-INF # nexus 運(yùn)行程序目錄

訪問私服

http://localhost:8081/nexus/


點(diǎn)擊右上角log in,輸入用戶名和密碼


默認(rèn)是admin/admin123

登錄完畢

上傳jar包到私服

在maven的setting.xml中配置

 <server> 
   <id>releases</id> 
   <username>admin</username> 
   <password>admin123</password> 
  </server> 
  <server> 
   <id>snapshots</id> 
   <username>admin</username> 
   <password>admin123</password> 
  </server> 

配置項(xiàng)目的pom文件

<distributionManagement>
    <repository>
      <id>releases</id>
      <url>http://localhost:8081/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

使用deploy命令即可將jar發(fā)布到私服,發(fā)布工程中的version,如果以snapshot結(jié)尾,則可以發(fā)布到快照倉庫,如果以release結(jié)尾,則可以發(fā)布到releases版本。

從私服下載jar包

在setting中配置私服倉庫

<distributionManagement>
    <repository>
      <id>releases</id>
      <url>http://localhost:8081/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

激活

 <activeProfiles> 
  <activeProfile>dev</activeProfile> 
 </activeProfiles> 

到此這篇關(guān)于maven私服的配置使用方法的文章就介紹到這了,更多相關(guān)maven私服配置使用內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論