[英]maven: using snapshot version before given timestamp
Assume that you are debugging the snapshot version of a product that was built 2 weeks back .假设您正在调试 2 周前构建的产品的快照版本。 So you have to build a version of a maven project A that is also 2 weeks old.所以你必须构建一个 Maven 项目 A 的版本,这个版本也是 2 周前的。 And this module depends on snapshot versions of another maven project B that has had some interface changes in this 2 weeks time.而这个模块依赖于另一个 maven 项目 B 的快照版本,该项目在这 2 周的时间里发生了一些界面变化。 So now Project A does not compile due to the interface changes in project B.所以现在由于项目B中的接口变化,项目A没有编译。
Question is how to force maven to use snapshot dependencies that is older than given timestamp (2 weeks or earlier in the example)?问题是如何强制 maven 使用早于给定时间戳(示例中为 2 周或更早)的快照依赖项?
Update: I can temporarily set the required version of project B. Something like <version>xyz-{timestamp}</version>
instead of <version>xyz-SNAPSHOT</version>
.更新:我可以临时设置项目 B 的所需版本。类似于<version>xyz-{timestamp}</version>
而不是<version>xyz-SNAPSHOT</version>
。 But its difficult to manage to when there are multiple dependencies and transitive dependecies.但是当存在多个依赖项和传递依赖项时很难管理。
If you need a version with reproducible builds, use release versions, not SNAPSHOTs.如果您需要具有可重现构建的版本,请使用发布版本,而不是快照。
SNAPSHOTs are purely for development and they may break any time. SNAPSHOT 纯粹用于开发,它们可能随时损坏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.