本文适用于,maven和nexus都已经正常配置,但是依赖包只能依赖RELEASE不能依赖SNAPSHOT
<mirror>
<id>Nexus</id>
<url>http://192.168.xxx.xxx/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
<mirror>
<id>Nexus2</id>
<url>http://192.168.xxx.xxx/content/groups/public/</url>
<mirrorOf>public-snapshots</mirrorOf> // 对snapshots有效
</mirror>
</mirrors>```
===========================================(娱乐分割线)
``` <profiles> //定义public-snapshots profile
<profile>
<id>public-snapshots</id>
<repositories>
<repository>
<id>public-snapshots</id>
<url>http://public- snapshots
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public-snapshots</id>
<url>http://public-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles> ```
===========================================(娱乐分割线)
```<activeProfiles>
<activeProfile>public-snapshots</activeProfile>
</activeProfiles> //使profile生效。 ```
相关指令:```mvn eclipse:eclipse```
![QQ图片20161101085642.png](https://img.haomeiwen.com/i2501502/df66ddd0d8a452c1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
网友评论