现在maven-3确实放弃了对<uniqueVersion> false </ uniqueVersion>的快照伪像的支持,似乎你真的需要使用带时间戳的SNAPSHOTS.特别是在内部使用maven 3的m2eclipse似乎受其影响,当SNAPSHOTS不是唯一时,更新快照不起作用.
以前将最佳快照设置为uniqueVersion = false 似乎是最佳做法
现在,切换到带时间戳的版本似乎没什么大问题,毕竟它们是由中央nexus存储库管理的,它可以在常规的intervalls中删除旧的快照.
问题是本地开发人员工作站.他们的本地存储库通过独特的快照很快变得非常大.
如何处理这个问题?
现在我看到了以下可能的解决方案:
保持本地存储库填满硬盘空间的最佳方法是什么?
更新:
为了验证beaviour并提供更多信息,我设置了一个小的nexus服务器,构建两个项目(a和b)并尝试:
A:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.glauche</groupId>
<artifactId>a</artifactId>
<version>0.0.1-SNAPSHOT</version>
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<name>nexus</name>
<url>http://server:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
Run Code Online (Sandbox Code Playgroud)
b:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.glauche</groupId>
<artifactId>b</artifactId>
<version>0.0.1-SNAPSHOT</version>
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<name>nexus</name>
<url>http://server:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>nexus</id>
<name>nexus</name>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://server:8081/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>de.glauche</groupId>
<artifactId>a</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency> …Run Code Online (Sandbox Code Playgroud) 我们的Archiva Repository永远不会删除旧的快照.这会产生大量垃圾.
是否有可能告诉Archiva只保留快照的N版本?
最诚挚的问候,基督徒.