如何在 Maven Central 中正确引用补丁版本

How to correctly reference patched versions in maven central

我对maven central中的依赖管理有疑问。我不得不说这是一个处于初始阶段的项目,我没有使用我自己的存储库,这就是为什么我有这个疑问。

GitHub dependabot 告诉我我使用的 jackson-databind 版本存在漏洞。

包com.fasterxml.jackson.core:jackson-databind (Maven) 受影响的版本 >= 2.13.0, <= 2.13.2.0 补丁版本 2.13.2.1

[ERROR] Failed to execute goal on project erp-cloud-api: Could not resolve dependencies for project es.test.api.cloud:cloud-api:jar:0.3.0: The following artifacts could not be resolved: com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.13.2.1, com.fasterxml.jackson.core:jackson-core:jar:2.13.2.1, com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2.1, com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.13.2.1, com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.13.2.1: com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.13.2.1 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

我在Maven核心中使用2.13.2版本,因为没有补丁版本。而 dependabot 仍然检测到该版本易受攻击。如何在不停止使用 Maven Central 的情况下解决此问题的正确方法?

我想要的是能够有一个可重现的构建并正确使用补丁版本。

非常感谢,如果方法已经说明了,抱歉。

解法:

那个版本确实存在。问题在于没有该版本的同一 groupId 的其他工件(如 jackson-annotations、jackson-databind 或 jackson-datatype-joda 等)。我使用一个通用的 属性 将它们组合在一起,这就是问题所在。谢谢!

对 Maven Central 的简短搜索显示 newest version of jackson-databind is 2.13.2.2.