中央存储库如何对版本号进行排序? [英] How does the Central Repository sort version numbers?

查看:86
本文介绍了中央存储库如何对版本号进行排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我维护一个开源项目,并将其发行版发布到中央存储库.我刚刚发布了oshi-core-2.6.我的pom.xml中该版本的版本为:

I maintain an open source project and publish its releases to The Central Repository. I just published oshi-core-2.6. The versioning in my pom.xml for that release reads:

<groupId>com.github.dblock</groupId>
<artifactId>oshi-core</artifactId>
<version>2.6</version>

由于日期/时间功能,我的代码需要Java 8.为了支持用户的请求,就在此发行版之前,我使用Threeten反向端口发布了Java 7兼容版本,其pom.xml中带有以下内容:

My code requires Java 8 due to the Date/Time functions. To support a user's request, just prior to this release, I released a Java 7 compatible version using the threeten backport, with the following in its pom.xml:

<groupId>com.github.dblock</groupId>
<artifactId>oshi-core</artifactId>
<version>2.6-m-java7</version>

版本号如何在Maven中工作状态所有带有限定符的版本都比没有限定符的相同版本(发行版)更早."另一个StackOverflow问题 maven如何对版本号进行排序?,给出了一个答案. ComparableVersion 类,其中列出了几个众所周知的限定符(alpha,beta,里程碑,rc和快照),它们应该比ga/final(空字符串)版本早"排序.

How Version Numbers Work in Maven states that "All versions with a qualifier are older than the same version without a qualifier (release version)." Another StackOverflow question, How does maven sort version numbers?, has an answer citing the ComparableVersion class which lists several well-known qualifiers (alpha, beta, milestone, rc, and snapshot) which are supposed to sort "earlier" than the ga/final (empty string) release.

由于在早期版本中具有自定义限定符,我尝试使用java7版本中的里程碑限定符(-m-)向Maven指示它应为2.6之前的较早"发行版.但是,搜索中央存储库显示了-m-版本是最新版本".

Having been bit by having a custom qualifier in an earlier version, I tried to use the milestone qualifier (-m-) in my java7 version to indicate to Maven that it should be an "earlier" release than 2.6. However, searching the Central Repository shows that the -m- version is the "Latest Version".

我有问题:

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