阿里雲私服

一、首先解壓nexus.zip壓縮包(安裝包已經存儲在百度雲盤中)
其中nexus-2.12.0-01是私服的主程序
sonatype-work是私服的倉庫java

安裝私服經過終端進入D:\maven\nexus\nexus-2.12.0-01\bin路徑
執行nexus.bat install安裝
查看系統服務,如有nesux服務說明安裝成功
安裝成功以後,要啓動私服服務
nexus.bat start啓動
系統服務當中的nexus服務已啓動,表名私服安裝啓動成功apache

若啓動安裝失敗,解決辦法:
找到nexus/bin/jsw/conf/wrapper.conf
第15行代碼的java改成java.exe的路徑app

訪問私服:http://localhost:8081/nexus
用戶名:admin
密碼:admin123maven

私服中有四種倉庫類型:
virtual 虛擬倉庫,不起任何做用
proxy 代理倉庫
代理apache:發佈,單非正式的jar
代理central 中央倉庫
hosted 宿主倉庫,本地倉庫
3rd:第三方倉庫,非本身的
releases本身配置的倉庫
group 組倉庫。從本身配製的多個倉庫中進行
查找,能夠本身配置group組。
在私服中選中group進行配置url

 

在maven 的 settings.xml 中,查找<mirrors></mirrors>,在其中添加以下代碼spa

    <mirror>
      <id>nexus-aliyun</id>
      <mirrorOf>central</mirrorOf>
      <name>Nexus aliyun</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>

 

在maven的settings.xml中,查找<><servers><servers>,在其中以下配置代理

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

 

在pom.xml中添加上傳私服的路徑code

<!-- 設置私服路徑 -->
<distributionManagement>
<repository>
<id>releases</id>    <url>http://localhost:8081/nexus/content/repositories/releases</url>
</repository>
<repository>
<id>snapshots</id>    <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</repository>
</distributionManagement>
相關文章
相關標籤/搜索