I have spring boot project and I try to use spring boot dependency-management plugin to be able to use provided dependency versions.
The plugin 'simulates' mavens BOM behaviour, which means that it somehow retrieves versions of libs from maven parent project (I'm not sure how exatly this gets acheived, but generally versions are taken from pom.xml). It does have jackson.version
property that is used to setup versions for artifacts within com.fasterxml.jackson.dataformat
group.
My project uses artifact from the same group, however it is not included into the BOM (jackson-dataformat-yaml
) but I want to use the same jackson version.
I tried adding compile dependency like this:
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jackson.version}"
but build fails with:
Could not get unknown property 'jackson' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Q: Is there a way to access the property? Or how else can I reuse the lib version?
UPDATE I'm not sure why didn't I try this from the very beginning, but it works:
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml"
However I have no clue why this works (the artifact is not declared anywhere).