我的目标是发布一个具有单一依赖项的项目。我有一个 nexus 存储库,我在其中部署快照和发布版本。
我有一个依赖
group:artifact:1.1.0-SNAPSHOT
并且下面的候选发布版本在我的 nexus repo 中发布
group:artifact:1.1.0-RC1
当要求版本插件解决依赖关系时,它声称没有新的依赖关系可用。所以他认为
1.1.0-SNAPSHOT > 1.1.0-RC1
但是,如果在我的项目中,我有 1.0.0-SNAPSHOT 版本,则 1.1.0-RC1 版本被解析为最新版本。
我错过了什么?(我查看了插件源代码,我们有以下代码段:
String otherQualifier = otherVersion.getQualifier();
if ( otherQualifier != null )
{
if ( ( qualifier.length() > otherQualifier.length() )
&& qualifier.startsWith( otherQualifier ) )
{
// here, the longer one that otherwise match is considered older
result = -1;
}
else if ( ( qualifier.length() < otherQualifier.length() )
&& otherQualifier.startsWith( qualifier ) )
{
// here, the longer one that otherwise match is considered older
result = 1;
}
else
{
result = qualifier.compareTo( otherQualifier );
}
}
这对我来说似乎是错误的。任何的想法?