Maven倉庫配置
阿新 • • 發佈:2018-12-25
如專案中使用到公司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>
|