Maven仓库配置

如项目中使用到公司Maven仓库信息,按如下配置修改

1、下载maven工具包

2、修改maven\conf下settings.xml

 

<settings xmlns= "<a href="http://maven.apache.org/SETTINGS/1.0.0" "="" style="color: rgb(59, 115, 175); text-decoration: none; border-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; background: none !important;">http://maven.apache.org/SETTINGS/1.0.0"
           xmlns:xsi= "<a href="http://www.w3.org/2001/XMLSchema-instance" "="" style="color: rgb(59, 115, 175); text-decoration: none; border-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; background: none !important;">http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation= "http://maven.apache.org/SETTINGS/1.0.0 <a href="http://maven.apache.org/xsd/settings-1.0.0.xsd" "="" style="color: rgb(59, 115, 175); text-decoration: none; border-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; background: none !important;">http://maven.apache.org/xsd/settings-1.0.0.xsd" >
     <!--设置本地仓库, 其中path to repository 根据自己的环境配置-->
     <localRepository>path to repository</localRepository>
 
 
     <pluginGroups>
     </pluginGroups>
 
 
     <proxies>
     </proxies>
 
 
     <!--设置私库认证信息-->
     <servers>
         <server>
             <id>nexus</id>
             <username>deployment</username>
             <password>ycode2015</password>
         </server>
         <server>
             <id>releases</id>           
             <username>deployment</username>
             <password>ycode2015</password>
         </server>
         <server>
             <id>snapshots</id>
             <username>deployment</username>
             <password>ycode2015</password>
         </server>
     </servers>
 
 
     <!--设置私库mirror 表示maven所有的请求都由nexus来处理-->
     <mirrors>
         <mirror>
             <id>nexus</id>
             <mirrorOf>*</mirrorOf>
             <name>Nexus Mirror.</name>
             <url>http: //nexus.ycode.cn/nexus/content/groups/public</url>
         </mirror>
     </mirrors>
 
 
     <!--设置maven私库信息-->
     <profiles>
         <profile>
             <id>nexus</id>
             <repositories>
                 <repository>
                     <id>nexus</id>
                     <name>Nexus</name>
                     <url>http: //nexus.ycode.cn/nexus/content/groups/public/</url>
                     <releases>
                         <enabled> true </enabled>
                     </releases>
                     <snapshots>
                         <enabled> true </enabled>
                     </snapshots>
                 </repository>
             </repositories>
             <pluginRepositories>
                 <pluginRepository>
                     <id>nexus</id>
                     <name>Nexus</name>
                     <url>http: //nexus.ycode.cn/nexus/content/groups/public/</url>
                     <releases>
                         <enabled> true </enabled>
                     </releases>
                     <snapshots>
                         <enabled> true </enabled>
                     </snapshots>
                 </pluginRepository>
 
 
             </pluginRepositories>
         </profile>
         <!--覆盖maven中央仓库设置开启releases和snapshots版本的下载-->
         <profile>
             <id>central</id>
             <repositories>
                 <repository>
                     <id>central</id>
                     <url>http: //central</url>
                     <releases>
                         <enabled> true </enabled>
                     </releases>
                     <snapshots>
                         <enabled> true </enabled>
                     </snapshots>
                 </repository>
             </repositories>
             <pluginRepositories>
                 <pluginRepository>
                     <id>central</id>
                     <url>http: //central</url>
                     <releases>
                         <enabled> true </enabled>
                     </releases>
                     <snapshots>
                         <enabled> true </enabled>
                     </snapshots>
                 </pluginRepository>
             </pluginRepositories>
         </profile>
     </profiles>
 
 
     <!--激活私库信息的配置-->
     <activeProfiles>
         <activeProfile>nexus</activeProfile>
         <activeProfile>central</activeProfile>
     </activeProfiles>
</settings>

idea maven配置如下

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值