简体   繁体   English

我可以为Maven工件提供4部分版本吗?

[英]Can I have a 4 part version for a maven artifact?

I have created a maven artifact that is a wrapper on a specific version of another maven artifact. 我创建了一个Maven工件,该工件是另一个Maven工件的特定版本的包装。 For ease of use, I would like to keep my version in sync with the artifact that I depend on. 为了易于使用,我想使我的版本与我依赖的工件保持同步。 However, I will likely be upgrading the version of my artifact more often than the other artifact's version. 但是,与其他工件的版本相比,我可能会更频繁地升级工件的版本。 So, I would like to do something like this: 所以,我想做这样的事情:

So, if the other artifact is like this: 因此,如果其他工件是这样的:

org.foo.bar:blarb:1.7.0

I would like to release something like this: 我想发布这样的内容:

org.foo.bar:blarb-wrapper:1.7.0.0

And that leaves me free to upgrade the wrapper to something like this: 这使我可以自由地将包装程序升级为以下内容:

org.foo.bar:blarb-wrapper:1.7.0.1

Both 1.7.0.0 and 1.7.0.1 of the wrapper will require 1.7.0 of blarb. 包装的1.7.0.0和1.7.0.1都需要1.7.0的blarb。 When blarb comes out with 1.7.1, I will release 1.7.1.0 (and potentially more along the way). 当blarb发布于1.7.1时,我将发布1.7.1.0(可能还会发布更多版本)。

So, my question is: Is this possible in maven, and if not what is a reasonable solution? 所以,我的问题是:这在行家中是否可能,如果没有,什么是合理的解决方案?

yes this is possible, as specified in the version-rules . 是的,这是可能的,如version-rules中所述 You can access parts of the versions via the build helper, parse version 您可以通过构建助手访问部分版本,解析版本

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

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