IDEA搭建mavrn私服(二)

设置maven的配置文件

1>:指定本地仓库位置:

<localRepository>E:\java\Maven\apache-maven-3.5.2\jar</localRepository>

 

2>:配置镜像路径

 

 <mirrors> 

   <mirror>

     <id>nexus</id>

     <mirrorOf>*</mirrorOf>

     <url>http://localhost:8081/nexus/content/groups/public/</url>

   </mirror>   

 </mirrors>

 


 

3>:设置镜像

 

<profiles>

   

   <profile>

     <id>nexus</id>

     <repositories>

       <repository>

         <id>central</id>

         <url>http://repol.maven.org/maven2/</url>

         <releases><enabled>true</enabled></releases>

         <snapshots><enabled>true</enabled></snapshots>

       </repository>

     </repositories>

 

     <pluginRepositories>

          <pluginRepository>

                   <id>central</id>

           <url>http://repol.maven.org/maven2/</url>

           <releases><enabled>true</enabled></releases>

           <snapshots><enabled>true</enabled></snapshots>

     </pluginRepository>

    </pluginRepositories>

   </profile>

 

 </profiles>

 

 

 <activeProfiles>

   <activeProfile>nexus</activeProfile>

 </activeProfiles>

 

4>:如果要从项目中把 整个仓库上传到nexus中还需要配置 账户权限

这里我配置了两个

<servers>

  

    |

   <server>

     <id>releases</id>

     <username>admin</username>

     <password>admin123</password>

   </server>

  

   <server>

     <id>snapshots</id>

     <username>deployment</username>

     <password>deployment123</password>

   </server>

   

 </servers>

 


 

指定了0.0.1-SNAPSHOT

即上传的位置在snopshots仓库中


到这里maven搭建完毕  如果出现配置错误可以参考学习

http://www.cnblogs.com/chowmin/articles/3930277.html

配置完成后就可以运用idea编辑器进行上传




 

 

 

 

并且还有在Pom.xml文件中配置



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值