由于加号登录版本,Maven 无法解析依赖项

Maven cannot resolve dependency due to plus sign in version

我有一个版本声明为“19.+”的 maven 依赖项,但 maven 失败了,即使 .m2 目录中存在与版本 20.0 相同的依赖项。

我以为版本中的这个加号是想说"fetch anything above this version"。有什么我想念的吗?

P.S。该版本声明是在我的一个依赖项中声明的,所以我实际上无法更改它。

此语法属于 Ivy 版本范围,Maven 不支持。它不应该在中央存储库的工件中使用,但有一些在有效版本被强制执行之前就已经使用了。

有关详细信息,请参阅 Enforcing valid dependency versions

E.g. a version of 16.+ has a meaning of any version from 16 up to anything smaller than 17 . These could be e.g. 16.3. Using such a syntax breaks the dependency mechanism of all other build systems and as such has to be avoided. Members of the Android Maven community have alerted us to problems caused by the usage of this invalid syntax.

...

we will be enforcing that no version of any dependency declaration in the pom uses this syntax or the 'latest' variant also possible in Ivy.

截至 2014 年 11 月(Dependency version range enforcement live on OSSRH ) this policy is in effect. You'll need to move to an upgraded version of that artifact. As this post says

In terms of changing old artifacts it has been a long standing rule for Central NOT to do any modifications. As such if you run into trouble with an artifact that uses the syntax I would urge you all to notify the offenders and ask them to fix it and release a new version.