如何在工件中配置更长的版本号 [英] How to configure a longer version Number in artifactory

查看:113
本文介绍了如何在工件中配置更长的版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的罐子的版本号必须比x.x.x更长。
我们宁愿需要x.x.x.x来集成一些老式的自制机制。
这是因为我们用xxx标记我们的软件,一旦我们交付给客户,就必须在这个时间点准确地构建一个特定的jar以适应另一个后端,
进行通信与我们的计划。出于这个原因,这个jar在生成时具有版本2.3.4.1,
,并且在下一次交付相同版本时,它构建并命名为2.3.4.2。
现在,artifactory无法处理这种情况,在某些情况下不能保存超过x.x.x.2。
所以我们想到可能在maven存储库布局中编辑正则表达式(参见附件截图)因为在下面的字段中测试路径显示,
它无法处理版本号。当然对于我们的其余罐子,xxx必须工作..

The version-numbers for our jars have to be longer them x.x.x. We would rather need x.x.x.x to integrate some old-fashioned self-made mechanism. This is, because we tag our software with x.x.x and as soon as we have a delivery to a customer one specific jar has to be build exactly at this point of time to fit to another backend, which communicates with our program. For that reason this one jar has the version 2.3.4.1, when generated and in next delivery of the same Version it is build and named 2.3.4.2. Now artifactory cannot handle this an doesn't save more than x.x.x.2 in some cases. So we thought of maybe edit the regular expression in the maven repository layout (see attached Screenshot) Because testing the path in the field below shows, that it cannot handle the version number. Of course for the rest of our jars still x.x.x has to work..

例如这里是maven-metadata.xml

For Example here is the maven-metadata.xml

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>com.firm</groupId>
  <artifactId>someid</artifactId>
  <version>1.5.1</version>
  <versioning>
    <latest>1.5.1</latest>
    <release>1.5.1</release>
    <versions>
      <version>1.4.62</version>
    </versions>
    <lastUpdated>20120926073942</lastUpdated>
  </versioning>
</metadata>

文件夹结构如下:

someid
- 1.4.62
- 1.4.62.1
- 1.4.62.2
- 1.4.62.3

someid - 1.4.62 - 1.4.62.1 - 1.4.62.2 - 1.4.62.3

如果我们部署新的工件版本(1.4.62.1),maven-metadata.xml包含1.4.62.1版本。
但是,在未指定的时间之后,artifactory会覆盖版本号(1.4.62.x)到(1.4.62)。似乎artifactory只支持major,minor和revision数字,并删除buildnumber。
现在我们正在寻找解决方案来禁用此行为。
我们使用JFrog Artifactory版本2.5.0(rev.13086)。

If we deploy an new artifact version (1.4.62.1), the maven-metadata.xml contains the 1.4.62.1 version. But the artifactory overrides the version number (1.4.62.x) to (1.4.62) after an unspecified time. It seems that the artifactory only support major, minor and revision numbers, and deletes the buildnumber. Now we looking for a solution do disable this behavior. We use the JFrog Artifactory version 2.5.0 (rev. 13086).

推荐答案

我提前道歉对您来说将是一个令人不满意的答案。

I apologize in advance that this will be an unsatisfactory answer for you.

您的版本格式与Maven使用的版本格式不兼容。 Maven使用..格式的版本号。在此之后的任何事情都需要以破折号为前提,以便Maven正确使用它。有关如何在Maven中使用和格式化版本号的更多信息,请参阅Maven书籍的这一部分: http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom-syntax.html

Your version format is incompatible with the version format used by Maven. Maven uses a .. format for version numbers. Anything after this needs to be prefaced with a dash for it to be properly used by Maven. For more information about how version numbers are used and formatted in Maven, please refer to this section of the Maven book: http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom-syntax.html

这篇关于如何在工件中配置更长的版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆