I'm having trouble taking the Jackson BOM into use...
# community-support
s
I'm having trouble taking the Jackson BOM into use. In
settings.gradle.kts
I have
Copy code
dependencyResolutionManagement {
    @Suppress("UnstableApiUsage")
    repositories {
        mavenCentral()
    }

    versionCatalogs {
        create("libs") {
            from(files("../gradle/libs.versions.toml"))
        }

        create("jackson") {
            from("com.fasterxml.jackson:jackson-bom:2.20.0")
        }
    }
}
which leads to
Copy code
Could not resolve all artifacts for configuration 'incomingCatalogForJackson0'.
> Could not resolve com.fasterxml.jackson:jackson-bom:2.20.0.
  Required by:
      unknown
   > No matching variant of com.fasterxml.jackson:jackson-bom:2.20.0 was found. The consumer was configured to find attribute 'org.gradle.category' with value 'platform', attribute 'org.gradle.usage' with value 'version-catalog' but:
       - Variant 'compile':
           - Incompatible because this component declares attribute 'org.gradle.category' with value 'library', attribute 'org.gradle.usage' with value 'java-api' and the consumer needed attribute 'org.gradle.category' with value 'platform', attribute 'org.gradle.usage' with value 'version-catalog'
       - Variant 'enforced-platform-compile':
           - Incompatible because this component declares attribute 'org.gradle.category' with value 'enforced-platform', attribute 'org.gradle.usage' with value 'java-api' and the consumer needed attribute 'org.gradle.category' with value 'platform', attribute 'org.gradle.usage' with value 'version-catalog'
What's wrong with my syntax?
t
a bom is not a version catalog is why that fails. do they publish a version catalog?
👆 1
s
No, they don't, AFAIK. But the blog article at https://zsiegel.com/using-gradle-version-catalogs-and-maven-boms/ claims it should work that way...
t
micronaut might publish a version catalog along side their bom is probably why. I can't find any version catalog artifact ID for jackson
s
I guess I need to use something like https://github.com/austinarbor/version-catalog-generator then...
t
oh thats a cool idea. let me know how it goes
s
t
thats super nice I like it
v
You can see at https://repo1.maven.org/maven2/io/micronaut/openapi/micronaut-openapi-bom/6.11.1/ that Micronaut indeed publishes bom and platform under the same coordinates and can find the variants in the GMM file. But I'd say that is rather seldomly done.
s
Though it's probably quite smart / convenient for the user to do it that way, as it just seems to magically work.
v
Well, like everything it has it's pros and cons. That way it is not obvious, as those are rather different kinds of artifacts. Especially if the coordinate name one of the usage types explicitly.