简体   繁体   English

maven:在给定时间戳之前使用快照版本

[英]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.

相关问题 使用jgitver在Maven版本中提交时间戳 - Commit timestamp in Maven version using jgitver 作为maven版本的一部分运行自定义插件,但在版本更新到下一个快照之前 - Run custom plugin as part of the maven release but before the version is updated to the next snapshot 如何使用 maven 从 nexus 检索快照的时间戳和内部版本号? - How to retrieve snapshot's timestamp & build number from nexus using maven? Maven发布插件:使用SNAPSHOT版本发布 - Maven release plugin : Releasing with a SNAPSHOT version 如何从 maven SNAPSHOT 存储库下载 SNAPSHOT 版本? - How to download SNAPSHOT version from maven SNAPSHOT repository? 使用 maven 发布快照并将两者发布到 Nexus - Publish snapshot and release both to Nexus using maven Maven:构建时没有release:plugin,也没有SNAPSHOT-version-number - Maven: Build without the release:plugin and without a SNAPSHOT-version-number Maven Release Plugin - 在发布中跳过快照版本更新:准备步骤 - Maven Release Plugin - Skip snapshot version update in release:prepare step 从 Gradle 中的 Maven Repository 获取最新的快照版本 - Get latest snapshot version from Maven Repository in Gradle 在带有插件的Maven中从Nexus选取最新版本(不是快照版本) - Picking Latest Release (not snapshot version) from Nexus in Maven with Plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM