简体   繁体   English

在Maven中修复快照版本的优点

[英]Advantages of fixing snapshot version in Maven

My project has snapshot dependencies for which no releases are available. 我的项目具有快照依赖性,因此没有可用的发行版。 If I fix the version, such as <version>0.0.1-20140219.100706-347</version> instead of <version>0.0.1-SNAPSHOT</version> , do I now enjoy the benefits in speed of using releases or am I still subject to automatic updates slowing my build down just by using a dependency that resides in a snapshot repository? 如果我修复了版本,例如<version>0.0.1-20140219.100706-347</version>而不是<version>0.0.1-SNAPSHOT</version> ,我现在是否可以享受使用发行版带来的好处?我仍然只能通过使用快照存储库中的依赖项来进行自动更新,从而减慢构建速度吗? Are there any benefits of releases then other than having kind of a tag to a specific version? 除了具有特定版本的标签之外,发布还有什么好处吗?

do I now enjoy the benefits in speed of using releases or am I still subject to automatic updates slowing my build down 我现在是否可以享受使用发行版带来的好处,还是我仍会受到自动更新的影响而减慢了构建速度

Yes; 是; a timestamped SNAPSHOT version refers to a unique artifact, so Maven won't check again. 带时间戳的SNAPSHOT版本是指唯一的工件,因此Maven不会再次检查。 You could also consider setting an update policy to reduce the frequency of checks ( How does the updatePolicy in maven really work? ). 您还可以考虑设置更新策略以减少检查的频率( maven中的updatePolicy如何真正起作用? )。

Are there any benefits of releases then other than having kind of a tag to a specific version? 除了具有特定版本的标签之外,发布还有什么好处吗?

As a general practice, SNAPSHOT builds (even timestamped ones) aren't intended to stick around. 通常, SNAPSHOT版本(甚至带有时间戳的版本)并不打算坚持下去。 Because you'll have one for every build it's normal to prune them (eg How to limit number of deployed snapshots artifacts in Nexus? ). 因为每个构建版本都有一个,所以修剪它们是正常的(例如, 如何限制Nexus中已部署快照构件的数量? )。 At some point you'll want to pick a specific version that will be kept permanently, and which can be used for reproducible builds: that's what final release versions are for. 在某个时候,您需要选择一个将永久保留的特定版本,并且该版本可用于可复制的版本:这就是最终发行版的用途。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM