I have a spring boot project, and I'm trying to use the spring plugin to manage boot dependencies in order to be able to use the provided version dependency.
The plugin "mimics" the behavior of the Mavens BOM, which means that it somehow extracts the lib versions from the parent maven project (I'm not sure how this works out completely, but in general the versions are taken from pom.xml ). It has a property jackson.version
that is used to set versions of artifacts in a group com.fasterxml.jackson.dataformat
.
My project uses an artifact from the same group, however it is not included in the specification ( jackson-dataformat-yaml
), but I want to use the same version of jackson.
I tried to add a compilation dependency as follows:
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jackson.version}"
but build failed:
Failed to 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 you reuse the lib version?
UPDATE
I'm not sure why I haven't tried this from the start, but it works:
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml"
However, I do not know why this works (the artifact is not declared anywhere).
source
share