搭建Maven私服,并配置Nexus环境

转:

http://wenku.baidu.com/link?url=91i2Ab6TFT85ebHP3ePIQOa1vTrPQ5rWuZCO7EtHhLN8SCwQ9IFs0q8tK7KqfTL7et13HH7LnCQ0bkAq90A-mLwpTkYJcQcLKW7RFV_mjGe

 

http://blog.csdn.net/shenshen123jun/article/details/9084293

 

<localRepository>D:\Maven\repository</localRepository>


<servers>  
   <server>
     <id>nexus-releases</id>
     <username>hunan</username>   
     <password>hunan</password> 
    </server>  
   <server>
     <id>nexus-snapshots</id>
     <username>hunan</username> 
     <password>hunan</password>  
   </server>
</servers>



<mirror>
   <id>nexus-mirror</id>
   <url>http://localhost:8081/nexus/content/repositories/central/</url>   
   <mirrorOf>*</mirrorOf>
</mirror>

<profiles>
        <profile>
           <id>nexus-profile</id>   
        <repositories>    
               <repository>
                 <id>nexus-repository</id>
                 <url>http://nexus-mirror</url>
                  <releases><enabled>true</enabled></releases>
                 <snapshots><enabled>true</enabled></snapshots>  
             </repository>   
        </repositories>
   <pluginRepositories> 
        <pluginRepository>
             <id>nexus-plugin-repository</id>   
              <url>http://nexus-mirror</url>
               <releases><enabled>true</enabled></releases>
             <snapshots><enabled>true</enabled></snapshots> 
            </pluginRepository>   
       </pluginRepositories>  
  </profile>
</profiles>
<activeProfiles>
  <activeProfile>nexus-profile</activeProfile> 
</activeProfiles>



如果开发中需要发布jar到Maven私服,提供给其他开发者下载,则需要在pom.xml文件中申明如下:
<distributionManagement>
     <repository>
           <id>nexus-releases</id>
          <name>Nexus Internal Releases Repository</name>
          <url>http://localhost:8081/nexus/content/repositories/releases/</url>
     </repository>
     <snapshotRepository>
          <id>nexus-snapshots</id>
           <name>Nexus Internal Snapshots Repository</name>
          <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
</distributionManagement>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值