不能使用 snapshot 的解決方式


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 的解決方式

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM