平静

遵循美德行事,纵使没有增加快乐,也可减轻焦虑。

导航

不能使用 snapshot 的解决方式

Posted on 2016-08-30 15:55  mdong  阅读(8247)  评论(0编辑  收藏  举报

http://www.mzone.cc/article/654.html

有两种方法可以解决:

1、第一种方法是在项目的pom文件中进行配置,如下

  1. <repositories>
  2. <repository>
  3. <id>cc-mzone-nexus</id>
  4. <name>MZONE</name>
  5. <url>http://192.168.1.112/nexus/content/groups/public/</url>
  6. <snapshots>
  7. <enabled>true</enabled>
  8. <updatePolicy>interval:5</updatePolicy>
  9. </snapshots>
  10. </repository>
  11. </repositories>

2、第二种方法是在maven的配置文件(conf/settings.xml)中进行配置,如下

  1. <profiles>
  2. <profile>
  3. <id>cc-mzone-profile</id>
  4. <repositories>
  5. <repository>
  6. <id>cc-mzone-nexus</id>
  7. <name>MZONE</name>
  8. <url>http://192.168.1.112/nexus/content/groups/public/</url>
  9. <releases>
  10. <enabled>true</enabled>
  11. </releases>
  12. <snapshots>
  13. <enabled>true</enabled>
  14. <updatePolicy>interval:10</updatePolicy>
  15. </snapshots>
  16. </repository>
  17. </repositories>
  18. </profile>
  19. </profiles>
  20. <activeProfiles>
  21. <activeProfile>cc-mzone-profile</activeProfile>
  22. </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>

  

 

 

 

 

 

http://www.cnblogs.com/adolfmc/p/5066466.html

maven 不能使用 snapshot 的解决方式