http://www.mzone.cc/article/654.html
有两种方法可以解决:
1、第一种方法是在项目的pom文件中进行配置,如下:
-
<repositories>
-
<repository>
-
<id>cc-mzone-nexus</id>
-
<name>MZONE</name>
-
<url>http://192.168.1.112/nexus/content/groups/public/</url>
-
<snapshots>
-
<enabled>true</enabled>
-
<updatePolicy>interval:5</updatePolicy>
-
</snapshots>
-
</repository>
-
</repositories>
2、第二种方法是在maven的配置文件(conf/settings.xml)中进行配置,如下:
-
<profiles>
-
<profile>
-
<id>cc-mzone-profile</id>
-
<repositories>
-
<repository>
-
<id>cc-mzone-nexus</id>
-
<name>MZONE</name>
-
<url>http://192.168.1.112/nexus/content/groups/public/</url>
-
<releases>
-
<enabled>true</enabled>
-
</releases>
-
<snapshots>
-
<enabled>true</enabled>
-
<updatePolicy>interval:10</updatePolicy>
-
</snapshots>
-
</repository>
-
</repositories>
-
</profile>
-
</profiles>
-
<activeProfiles>
-
<activeProfile>cc-mzone-profile</activeProfile>
-
</activeProfiles>
以上两种方式都是打开snapshot快照库,允许快照库生效(重要就是snapshot中enabled要设置为true),第一种是项目级别的,第二种是全局的。出现的问题当然主要还是默认snapshot快照库是没有生效导致的,如此配置即可解决问题!
jshuai:
把下面放到pom.xml里
<repositories> <repository> <id>nexus</id> <name>Nexus Mirror</name> <url>http://xxx.xxx.com:1234/nexus/content/groups/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
网络:
<repositories> <repository> <id>test-nexus</id> <name>test</name> <url>http://192.168.1.253/nexus/content/groups/public/</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
或者是修改settings.mxl
<profile> <id>nexus</id> <repositories> <repository> <id>central</id> <name>Nexus</name> <url>http://192.168.1.253/nexus/content/groups/public/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <name>Nexus</name> <url>http://192.168.1.253/nexus/content/groups/public/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>nexus</activeProfile> </activeProfiles>