Spring-security classes not resolving in Grails app - Spring-Security is in dependency report - gradle

I am building an app with pretty basic security in Grails. I had Spring Security working in the app, but then was forced by my employer to upgrade the grails version to 5.23 from 4.06 for security reasons. As a result, Spring Security imports are not resolved, and the classes obviously won't compile. I've cleaned, and the problem persists.
Here is the dependency section of my build.gradle:
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
console "org.grails:grails-console"
compileOnly "io.micronaut:micronaut-inject-groovy"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-autoconfigure"
implementation "org.grails:grails-core"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-tomcat"
implementation "org.grails:grails-web-boot"
implementation "org.grails:grails-logging"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-plugin-i18n"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails.plugins:cache"
implementation "org.grails.plugins:async"
implementation "org.grails.plugins:scaffolding"
implementation "org.grails.plugins:events"
implementation "org.grails.plugins:hibernate5"
implementation "org.hibernate:hibernate-core:5.6.9.Final"
implementation "org.grails.plugins:gsp"
implementation 'org.passay:passay:1.6.1'
implementation 'org.springframework.security:spring-security-core:4.2.16.RELEASE'
implementation "io.projectreactor.netty:reactor-netty-core:1.0.11"
implementation "io.projectreactor.netty:reactor-netty-http:1.0.11"
profile "org.grails.profiles:web"
runtimeOnly "org.glassfish.web:el-impl:2.1.2-b03"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
runtimeOnly "javax.xml.bind:jaxb-api:2.3.1"
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:3.3.1"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.mockito:mockito-core"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.grails.plugins:geb"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:3.14.0"
testImplementation "org.seleniumhq.selenium:selenium-api:3.14.0"
testImplementation "org.seleniumhq.selenium:selenium-support:3.14.0"
testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:3.14.0"
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:3.14.0"
}
I'd like to attach the entire dependency report, but it's huge, so here's what I think is the relevant portion:
...
| \--- org.grails:grails-encoder:5.2.3 (*)
+--- org.passay:passay:1.6.1
+--- org.springframework.security:spring-security-core:4.2.16.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-aop:4.3.26.RELEASE -> 5.3.20 (*)
| +--- org.springframework:spring-beans:4.3.26.RELEASE -> 5.3.20 (*)
| +--- org.springframework:spring-context:4.3.26.RELEASE -> 5.3.20 (*)
| +--- org.springframework:spring-core:4.3.26.RELEASE -> 5.3.20 (*)
| \--- org.springframework:spring-expression:4.3.26.RELEASE -> 5.3.20 (*)
+--- io.projectreactor.netty:reactor-netty-core:1.0.11
| +--- io.netty:netty-handler:4.1.68.Final -> 4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-resolver:4.1.77.Final
| | | \--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-buffer:4.1.77.Final
| | | \--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-transport:4.1.77.Final
| | | +--- io.netty:netty-common:4.1.77.Final
| | | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | | \--- io.netty:netty-resolver:4.1.77.Final (*)
| | \--- io.netty:netty-codec:4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | \--- io.netty:netty-transport:4.1.77.Final (*)
| +--- io.netty:netty-handler-proxy:4.1.68.Final -> 4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | +--- io.netty:netty-transport:4.1.77.Final (*)
| | +--- io.netty:netty-codec:4.1.77.Final (*)
| | +--- io.netty:netty-codec-socks:4.1.77.Final
| | | +--- io.netty:netty-common:4.1.77.Final
| | | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | | +--- io.netty:netty-transport:4.1.77.Final (*)
| | | \--- io.netty:netty-codec:4.1.77.Final (*)
| | \--- io.netty:netty-codec-http:4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | +--- io.netty:netty-transport:4.1.77.Final (*)
| | +--- io.netty:netty-codec:4.1.77.Final (*)
| | \--- io.netty:netty-handler:4.1.77.Final (*)
| +--- io.netty:netty-resolver-dns:4.1.68.Final -> 4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | +--- io.netty:netty-resolver:4.1.77.Final (*)
| | +--- io.netty:netty-transport:4.1.77.Final (*)
| | +--- io.netty:netty-codec:4.1.77.Final (*)
| | +--- io.netty:netty-codec-dns:4.1.77.Final
| | | +--- io.netty:netty-common:4.1.77.Final
| | | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | | +--- io.netty:netty-transport:4.1.77.Final (*)
| | | \--- io.netty:netty-codec:4.1.77.Final (*)
| | \--- io.netty:netty-handler:4.1.77.Final (*)
| +--- io.netty:netty-resolver-dns-native-macos:4.1.68.Final -> 4.1.77.Final
| | \--- io.netty:netty-resolver-dns-classes-macos:4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-resolver-dns:4.1.77.Final (*)
| | \--- io.netty:netty-transport-native-unix-common:4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | \--- io.netty:netty-transport:4.1.77.Final (*)
| +--- io.netty:netty-transport-native-epoll:4.1.68.Final -> 4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | +--- io.netty:netty-transport:4.1.77.Final (*)
| | +--- io.netty:netty-transport-native-unix-common:4.1.77.Final (*)
| | \--- io.netty:netty-transport-classes-epoll:4.1.77.Final
| | +--- io.netty:netty-common:4.1.77.Final
| | +--- io.netty:netty-buffer:4.1.77.Final (*)
| | +--- io.netty:netty-transport:4.1.77.Final (*)
| | \--- io.netty:netty-transport-native-unix-common:4.1.77.Final (*)
| \--- io.projectreactor:reactor-core:3.4.10 -> 3.4.18
| \--- org.reactivestreams:reactive-streams:1.0.3
\--- io.projectreactor.netty:reactor-netty-http:1.0.11
+--- io.netty:netty-codec-http:4.1.68.Final -> 4.1.77.Final (*)
+--- io.netty:netty-codec-http2:4.1.68.Final -> 4.1.77.Final
| +--- io.netty:netty-common:4.1.77.Final
| +--- io.netty:netty-buffer:4.1.77.Final (*)
| +--- io.netty:netty-transport:4.1.77.Final (*)
| +--- io.netty:netty-codec:4.1.77.Final (*)
| +--- io.netty:netty-handler:4.1.77.Final (*)
| \--- io.netty:netty-codec-http:4.1.77.Final (*)
+--- io.netty:netty-resolver-dns:4.1.68.Final -> 4.1.77.Final (*)
+--- io.netty:netty-resolver-dns-native-macos:4.1.68.Final -> 4.1.77.Final (*)
+--- io.netty:netty-transport-native-epoll:4.1.68.Final -> 4.1.77.Final (*)
+--- io.projectreactor.netty:reactor-netty-core:1.0.11 (*)
\--- io.projectreactor:reactor-core:3.4.10 -> 3.4.18 (*)
...

Related

Spring Boot Application Returns 401 UnAuthorized on All Endpoints

In a very specific scenario outlined below, my Spring Boot application returns the following response for all endpoints:
/ $ curl http://localhost:8084/
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 UnAuthorized</title>
</head>
<body><h2>HTTP ERROR 401 UnAuthorized</h2>
<table>
<tr><th>URI:</th><td>/</td></tr>
<tr><th>STATUS:</th><td>401</td></tr>
<tr><th>MESSAGE:</th><td>UnAuthorized</td></tr>
<tr><th>SERVLET:</th><td>dispatcherServlet</td></tr>
</table>
</body>
</html>
/ $
I only get this response from the pod being spun up, when I attempt to use Telepresence to intercept a running Kubernetes pod (telepresence intercept my-service). This 401 response by the pod coming up causes the startup, liveness and readiness probes to fail, which causes Telepresence to never replace the pod with its traffic manager and redirect to my locally running instance.
Any ideas on what this error message means, and how to fix it? I'm not even sure that it's coming from Spring.
I do not have Spring Security on the classpath. Dependencies:
> Task :dependencies
------------------------------------------------------------
Root project 'foo'
------------------------------------------------------------
runtimeClasspath - Runtime classpath of source set 'main'.
+--- org.springframework.boot:spring-boot-devtools -> 2.6.8
| +--- org.springframework.boot:spring-boot:2.6.8
| | +--- org.springframework:spring-core:5.3.20
| | | \--- org.springframework:spring-jcl:5.3.20
| | \--- org.springframework:spring-context:5.3.20
| | +--- org.springframework:spring-aop:5.3.20
| | | +--- org.springframework:spring-beans:5.3.20
| | | | \--- org.springframework:spring-core:5.3.20 (*)
| | | \--- org.springframework:spring-core:5.3.20 (*)
| | +--- org.springframework:spring-beans:5.3.20 (*)
| | +--- org.springframework:spring-core:5.3.20 (*)
| | \--- org.springframework:spring-expression:5.3.20
| | \--- org.springframework:spring-core:5.3.20 (*)
| \--- org.springframework.boot:spring-boot-autoconfigure:2.6.8
| \--- org.springframework.boot:spring-boot:2.6.8 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.8
| +--- org.springframework.boot:spring-boot-starter:2.6.8
| | +--- org.springframework.boot:spring-boot:2.6.8 (*)
| | +--- org.springframework.boot:spring-boot-autoconfigure:2.6.8 (*)
| | +--- org.springframework.boot:spring-boot-starter-logging:2.6.8
| | | +--- ch.qos.logback:logback-classic:1.2.11
| | | | +--- ch.qos.logback:logback-core:1.2.11
| | | | \--- org.slf4j:slf4j-api:1.7.32 -> 1.7.36
| | | +--- org.apache.logging.log4j:log4j-to-slf4j:2.17.2
| | | | +--- org.slf4j:slf4j-api:1.7.35 -> 1.7.36
| | | | \--- org.apache.logging.log4j:log4j-api:2.17.2
| | | \--- org.slf4j:jul-to-slf4j:1.7.36
| | | \--- org.slf4j:slf4j-api:1.7.36
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | +--- org.springframework:spring-core:5.3.20 (*)
| | \--- org.yaml:snakeyaml:1.29
| +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.8
| | +--- com.fasterxml.jackson.core:jackson-databind:2.13.3
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.13.3
| | | | \--- com.fasterxml.jackson:jackson-bom:2.13.3
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.13.3 (c)
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.13.3 (c)
| | | | +--- com.fasterxml.jackson.core:jackson-databind:2.13.3 (c)
| | | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.3 (c)
| | | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3 (c)
| | | | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.3 (c)
| | | +--- com.fasterxml.jackson.core:jackson-core:2.13.3
| | | | \--- com.fasterxml.jackson:jackson-bom:2.13.3 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.13.3 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.13.3 (*)
| | | +--- com.fasterxml.jackson.core:jackson-core:2.13.3 (*)
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.13.3 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.13.3 (*)
| | +--- org.springframework.boot:spring-boot-actuator:2.6.8
| | | \--- org.springframework.boot:spring-boot:2.6.8 (*)
| | +--- org.springframework.boot:spring-boot:2.6.8 (*)
| | \--- org.springframework.boot:spring-boot-autoconfigure:2.6.8 (*)
| \--- io.micrometer:micrometer-core:1.8.6
| +--- org.hdrhistogram:HdrHistogram:2.1.12
| \--- org.latencyutils:LatencyUtils:2.0.3
+--- org.springframework.boot:spring-boot-starter-data-jpa -> 2.6.8
| +--- org.springframework.boot:spring-boot-starter-aop:2.6.8
| | +--- org.springframework.boot:spring-boot-starter:2.6.8 (*)
| | +--- org.springframework:spring-aop:5.3.20 (*)
| | \--- org.aspectj:aspectjweaver:1.9.7
| +--- org.springframework.boot:spring-boot-starter-jdbc:2.6.8
| | +--- org.springframework.boot:spring-boot-starter:2.6.8 (*)
| | +--- com.zaxxer:HikariCP:4.0.3
| | | \--- org.slf4j:slf4j-api:1.7.30 -> 1.7.36
| | \--- org.springframework:spring-jdbc:5.3.20
| | +--- org.springframework:spring-beans:5.3.20 (*)
| | +--- org.springframework:spring-core:5.3.20 (*)
| | \--- org.springframework:spring-tx:5.3.20
| | +--- org.springframework:spring-beans:5.3.20 (*)
| | \--- org.springframework:spring-core:5.3.20 (*)
| +--- jakarta.transaction:jakarta.transaction-api:1.3.3
| +--- jakarta.persistence:jakarta.persistence-api:2.2.3
| +--- org.hibernate:hibernate-core:5.6.9.Final
| | +--- org.jboss.logging:jboss-logging:3.4.3.Final
| | +--- net.bytebuddy:byte-buddy:1.12.9 -> 1.11.22
| | +--- antlr:antlr:2.7.7
| | +--- org.jboss:jandex:2.4.2.Final
| | +--- com.fasterxml:classmate:1.5.1
| | +--- org.hibernate.common:hibernate-commons-annotations:5.1.2.Final
| | | \--- org.jboss.logging:jboss-logging:3.3.2.Final -> 3.4.3.Final
| | \--- org.glassfish.jaxb:jaxb-runtime:2.3.1 -> 2.3.6
| | +--- jakarta.xml.bind:jakarta.xml.bind-api:2.3.3
| | +--- org.glassfish.jaxb:txw2:2.3.6
| | +--- com.sun.istack:istack-commons-runtime:3.0.12
| | \--- com.sun.activation:jakarta.activation:1.2.2
| +--- org.springframework.data:spring-data-jpa:2.6.4
| | +--- org.springframework.data:spring-data-commons:2.6.4
| | | +--- org.springframework:spring-core:5.3.19 -> 5.3.20 (*)
| | | +--- org.springframework:spring-beans:5.3.19 -> 5.3.20 (*)
| | | \--- org.slf4j:slf4j-api:1.7.32 -> 1.7.36
| | +--- org.springframework:spring-orm:5.3.19 -> 5.3.20
| | | +--- org.springframework:spring-beans:5.3.20 (*)
| | | +--- org.springframework:spring-core:5.3.20 (*)
| | | +--- org.springframework:spring-jdbc:5.3.20 (*)
| | | \--- org.springframework:spring-tx:5.3.20 (*)
| | +--- org.springframework:spring-context:5.3.19 -> 5.3.20 (*)
| | +--- org.springframework:spring-aop:5.3.19 -> 5.3.20 (*)
| | +--- org.springframework:spring-tx:5.3.19 -> 5.3.20 (*)
| | +--- org.springframework:spring-beans:5.3.19 -> 5.3.20 (*)
| | +--- org.springframework:spring-core:5.3.19 -> 5.3.20 (*)
| | \--- org.slf4j:slf4j-api:1.7.32 -> 1.7.36
| \--- org.springframework:spring-aspects:5.3.20
| \--- org.aspectj:aspectjweaver:1.9.7
+--- org.springframework.boot:spring-boot-starter-web -> 2.6.8
| +--- org.springframework.boot:spring-boot-starter:2.6.8 (*)
| +--- org.springframework.boot:spring-boot-starter-json:2.6.8
| | +--- org.springframework.boot:spring-boot-starter:2.6.8 (*)
| | +--- org.springframework:spring-web:5.3.20
| | | +--- org.springframework:spring-beans:5.3.20 (*)
| | | \--- org.springframework:spring-core:5.3.20 (*)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.13.3 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.3
| | | +--- com.fasterxml.jackson.core:jackson-core:2.13.3 (*)
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.13.3 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.13.3 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3 (*)
| | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.3
| | +--- com.fasterxml.jackson.core:jackson-core:2.13.3 (*)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.13.3 (*)
| | \--- com.fasterxml.jackson:jackson-bom:2.13.3 (*)
| +--- org.springframework:spring-web:5.3.20 (*)
| \--- org.springframework:spring-webmvc:5.3.20
| +--- org.springframework:spring-aop:5.3.20 (*)
| +--- org.springframework:spring-beans:5.3.20 (*)
| +--- org.springframework:spring-context:5.3.20 (*)
| +--- org.springframework:spring-core:5.3.20 (*)
| +--- org.springframework:spring-expression:5.3.20 (*)
| \--- org.springframework:spring-web:5.3.20 (*)
+--- org.springframework.boot:spring-boot-starter-jetty -> 2.6.8
| +--- jakarta.servlet:jakarta.servlet-api:4.0.4
| +--- jakarta.websocket:jakarta.websocket-api:1.1.2
| +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.63
| +--- org.eclipse.jetty:jetty-servlets:9.4.46.v20220331
| | +--- org.eclipse.jetty:jetty-continuation:9.4.46.v20220331
| | +--- org.eclipse.jetty:jetty-http:9.4.46.v20220331
| | | +--- org.eclipse.jetty:jetty-util:9.4.46.v20220331
| | | \--- org.eclipse.jetty:jetty-io:9.4.46.v20220331
| | | \--- org.eclipse.jetty:jetty-util:9.4.46.v20220331
| | +--- org.eclipse.jetty:jetty-util:9.4.46.v20220331
| | \--- org.eclipse.jetty:jetty-io:9.4.46.v20220331 (*)
| +--- org.eclipse.jetty:jetty-webapp:9.4.46.v20220331
| | +--- org.eclipse.jetty:jetty-xml:9.4.46.v20220331
| | | \--- org.eclipse.jetty:jetty-util:9.4.46.v20220331
| | \--- org.eclipse.jetty:jetty-servlet:9.4.46.v20220331
| | +--- org.eclipse.jetty:jetty-security:9.4.46.v20220331
| | | \--- org.eclipse.jetty:jetty-server:9.4.46.v20220331
| | | +--- org.eclipse.jetty:jetty-http:9.4.46.v20220331 (*)
| | | \--- org.eclipse.jetty:jetty-io:9.4.46.v20220331 (*)
| | \--- org.eclipse.jetty:jetty-util-ajax:9.4.46.v20220331
| | \--- org.eclipse.jetty:jetty-util:9.4.46.v20220331
| +--- org.eclipse.jetty.websocket:websocket-server:9.4.46.v20220331
| | +--- org.eclipse.jetty.websocket:websocket-common:9.4.46.v20220331
| | | +--- org.eclipse.jetty.websocket:websocket-api:9.4.46.v20220331
| | | +--- org.eclipse.jetty:jetty-util:9.4.46.v20220331
| | | \--- org.eclipse.jetty:jetty-io:9.4.46.v20220331 (*)
| | +--- org.eclipse.jetty.websocket:websocket-client:9.4.46.v20220331
| | | +--- org.eclipse.jetty:jetty-client:9.4.46.v20220331
| | | | +--- org.eclipse.jetty:jetty-http:9.4.46.v20220331 (*)
| | | | \--- org.eclipse.jetty:jetty-io:9.4.46.v20220331 (*)
| | | +--- org.eclipse.jetty:jetty-util:9.4.46.v20220331
| | | +--- org.eclipse.jetty:jetty-io:9.4.46.v20220331 (*)
| | | \--- org.eclipse.jetty.websocket:websocket-common:9.4.46.v20220331 (*)
| | +--- org.eclipse.jetty.websocket:websocket-servlet:9.4.46.v20220331
| | | \--- org.eclipse.jetty.websocket:websocket-api:9.4.46.v20220331
| | +--- org.eclipse.jetty:jetty-servlet:9.4.46.v20220331 (*)
| | \--- org.eclipse.jetty:jetty-http:9.4.46.v20220331 (*)
| \--- org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.46.v20220331
| +--- org.eclipse.jetty:jetty-annotations:9.4.46.v20220331
| | +--- org.eclipse.jetty:jetty-plus:9.4.46.v20220331
| | | \--- org.eclipse.jetty:jetty-webapp:9.4.46.v20220331 (*)
| | +--- org.eclipse.jetty:jetty-webapp:9.4.46.v20220331 (*)
| | +--- org.ow2.asm:asm:9.2
| | \--- org.ow2.asm:asm-commons:9.2
| | +--- org.ow2.asm:asm:9.2
| | +--- org.ow2.asm:asm-tree:9.2
| | | \--- org.ow2.asm:asm:9.2
| | \--- org.ow2.asm:asm-analysis:9.2
| | \--- org.ow2.asm:asm-tree:9.2 (*)
| +--- org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.46.v20220331
| | \--- org.eclipse.jetty.websocket:websocket-client:9.4.46.v20220331 (*)
| \--- org.eclipse.jetty.websocket:websocket-server:9.4.46.v20220331 (*)
+--- org.postgresql:postgresql -> 42.3.5
| \--- org.checkerframework:checker-qual:3.5.0 -> 3.8.0
+--- org.flywaydb:flyway-core -> 8.0.5
+--- org.apache.commons:commons-lang3:3.9
+--- javax.validation:validation-api:2.0.1.Final
+--- javax.annotation:javax.annotation-api:1.3.2
+--- com.google.guava:guava:30.1.1-jre
| +--- com.google.guava:failureaccess:1.0.1
| +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
| +--- com.google.code.findbugs:jsr305:3.0.2
| +--- org.checkerframework:checker-qual:3.8.0
| +--- com.google.errorprone:error_prone_annotations:2.5.1
| \--- com.google.j2objc:j2objc-annotations:1.3
+--- io.swagger:swagger-annotations:1.6.3
+--- org.openapitools:jackson-databind-nullable:0.2.2
| \--- com.fasterxml.jackson.core:jackson-databind:2.12.2 -> 2.13.3 (*)
\--- io.springfox:springfox-core:3.0.0
+--- net.bytebuddy:byte-buddy:1.10.11 -> 1.11.22
+--- com.fasterxml:classmate:1.5.1
+--- org.slf4j:slf4j-api:1.7.25 -> 1.7.36
+--- org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE
| +--- org.springframework:spring-beans:5.2.0.RELEASE -> 5.3.20 (*)
| +--- org.springframework:spring-context:5.2.0.RELEASE -> 5.3.20 (*)
| +--- org.springframework:spring-aop:5.2.0.RELEASE -> 5.3.20 (*)
| \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.36
\--- org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE
+--- org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE (*)
\--- org.slf4j:slf4j-api:1.7.25 -> 1.7.36
(c) - dependency constraint
(*) - dependencies omitted (listed previously)
A web-based, searchable dependency report is available by adding the --scan option.
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

class com.fasterxml.jackson.dataformat.xml.XmlMapper is loading from from multiple locations

I am puzzled to solve this com.fasterxml.jackson.dataformat.xml.XmlMapper error with Java 11. I want to use XmlMapper only from jackson dependency and that's why excluded from springboot starter web , still cannot figure how to resolve it's dependency. providing as much details as possible -
build.gradle
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
jaxb
fatJar
}
repositories {
mavenCentral()
}
dependencies {
implementation ('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
}
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
compileOnly 'org.projectlombok:lombok:1.18.4'
annotationProcessor 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.12.2'
compile("com.newrelic.logging:logback:2.0")
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.4'
jaxb (
'com.sun.xml.bind:jaxb-xjc:2.3.1',
'com.sun.xml.bind:jaxb-impl:2.3.1',
'org.glassfish.jaxb:jaxb-runtime:2.3.3'
)
}
dependency hierarchy
+--- com.newrelic.logging:logback:2.0
+--- org.springframework.boot:spring-boot-starter-web -> 2.4.5
| +--- org.springframework.boot:spring-boot-starter:2.4.5
| | +--- org.springframework.boot:spring-boot:2.4.5
| | | +--- org.springframework:spring-core:5.3.6
| | | | \--- org.springframework:spring-jcl:5.3.6
| | | \--- org.springframework:spring-context:5.3.6
| | | +--- org.springframework:spring-aop:5.3.6
| | | | +--- org.springframework:spring-beans:5.3.6
| | | | | \--- org.springframework:spring-core:5.3.6 (*)
| | | | \--- org.springframework:spring-core:5.3.6 (*)
| | | +--- org.springframework:spring-beans:5.3.6 (*)
| | | +--- org.springframework:spring-core:5.3.6 (*)
| | | \--- org.springframework:spring-expression:5.3.6
| | | \--- org.springframework:spring-core:5.3.6 (*)
| | +--- org.springframework.boot:spring-boot-autoconfigure:2.4.5
| | | \--- org.springframework.boot:spring-boot:2.4.5 (*)
| | +--- org.springframework.boot:spring-boot-starter-logging:2.4.5
| | | +--- ch.qos.logback:logback-classic:1.2.3
| | | | +--- ch.qos.logback:logback-core:1.2.3
| | | | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | +--- org.apache.logging.log4j:log4j-to-slf4j:2.13.3
| | | | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | | \--- org.apache.logging.log4j:log4j-api:2.13.3
| | | \--- org.slf4j:jul-to-slf4j:1.7.30
| | | \--- org.slf4j:slf4j-api:1.7.30
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | +--- org.springframework:spring-core:5.3.6 (*)
| | \--- org.yaml:snakeyaml:1.27
| +--- org.springframework.boot:spring-boot-starter-json:2.4.5
| | +--- org.springframework.boot:spring-boot-starter:2.4.5 (*)
| | +--- org.springframework:spring-web:5.3.6
| | | +--- org.springframework:spring-beans:5.3.6 (*)
| | | \--- org.springframework:spring-core:5.3.6 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4
| | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4
| +--- org.springframework.boot:spring-boot-starter-tomcat:2.4.5
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.45
| | +--- org.glassfish:jakarta.el:3.0.3
| | \--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.45
| | \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.45
| +--- org.springframework:spring-web:5.3.6 (*)
| \--- org.springframework:spring-webmvc:5.3.6
| +--- org.springframework:spring-aop:5.3.6 (*)
| +--- org.springframework:spring-beans:5.3.6 (*)
| +--- org.springframework:spring-context:5.3.6 (*)
| +--- org.springframework:spring-core:5.3.6 (*)
| +--- org.springframework:spring-expression:5.3.6 (*)
| \--- org.springframework:spring-web:5.3.6 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.4.5
| +--- org.springframework.boot:spring-boot-starter:2.4.5 (*)
| +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.4.5
| | +--- org.springframework.boot:spring-boot-actuator:2.4.5
| | | \--- org.springframework.boot:spring-boot:2.4.5 (*)
| | +--- org.springframework.boot:spring-boot:2.4.5 (*)
| | \--- org.springframework.boot:spring-boot-autoconfigure:2.4.5 (*)
| \--- io.micrometer:micrometer-core:1.6.6
| \--- org.hdrhistogram:HdrHistogram:2.1.12
+--- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.12.2
| +--- com.fasterxml.jackson.core:jackson-core:2.12.2 -> 2.11.4
| +--- com.fasterxml.jackson.core:jackson-annotations:2.12.2 -> 2.11.4
| +--- com.fasterxml.jackson.core:jackson-databind:2.12.2 -> 2.11.4
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.4
| | \--- com.fasterxml.jackson.core:jackson-core:2.11.4
| +--- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.2 -> 2.11.4
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.4
| | +--- com.fasterxml.jackson.core:jackson-core:2.11.4
| | +--- com.fasterxml.jackson.core:jackson-databind:2.11.4 (*)
| | +--- jakarta.xml.bind:jakarta.xml.bind-api:2.3.2 -> 2.3.3
| | | \--- jakarta.activation:jakarta.activation-api:1.2.2
| | \--- jakarta.activation:jakarta.activation-api:1.2.1 -> 1.2.2
| +--- org.codehaus.woodstox:stax2-api:4.2.1
| +--- com.fasterxml.woodstox:woodstox-core:6.2.4
| | \--- org.codehaus.woodstox:stax2-api:4.2.1
| \--- com.fasterxml.jackson:jackson-bom:2.12.2
| +--- com.fasterxml.jackson.core:jackson-annotations:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.core:jackson-core:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.core:jackson-databind:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.12.2 (c)
| +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.2 -> 2.11.4 (c)
| \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.2 -> 2.11.4 (c)
+--- javax.xml.bind:jaxb-api:2.2.4
| +--- javax.xml.stream:stax-api:1.0-2
| \--- javax.activation:activation:1.1
\--- org.springframework.boot:spring-boot-starter-test -> 2.4.5
+--- org.springframework.boot:spring-boot-starter:2.4.5 (*)
+--- org.springframework.boot:spring-boot-test:2.4.5
| \--- org.springframework.boot:spring-boot:2.4.5 (*)
+--- org.springframework.boot:spring-boot-test-autoconfigure:2.4.5
| +--- org.springframework.boot:spring-boot:2.4.5 (*)
| +--- org.springframework.boot:spring-boot-test:2.4.5 (*)
| \--- org.springframework.boot:spring-boot-autoconfigure:2.4.5 (*)
+--- com.jayway.jsonpath:json-path:2.4.0
| +--- net.minidev:json-smart:2.3
| | \--- net.minidev:accessors-smart:1.2
| | \--- org.ow2.asm:asm:5.0.4
| \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
+--- jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 (*)
+--- org.assertj:assertj-core:3.18.1
+--- org.hamcrest:hamcrest:2.2
+--- org.junit.jupiter:junit-jupiter:5.7.1
| +--- org.junit:junit-bom:5.7.1
| | +--- org.junit.jupiter:junit-jupiter:5.7.1 (c)
| | +--- org.junit.jupiter:junit-jupiter-api:5.7.1 (c)
| | +--- org.junit.jupiter:junit-jupiter-params:5.7.1 (c)
| | \--- org.junit.platform:junit-platform-commons:1.7.1 (c)
| +--- org.junit.jupiter:junit-jupiter-api:5.7.1
| | +--- org.junit:junit-bom:5.7.1 (*)
| | +--- org.apiguardian:apiguardian-api:1.1.0
| | +--- org.opentest4j:opentest4j:1.2.0
| | \--- org.junit.platform:junit-platform-commons:1.7.1
| | +--- org.junit:junit-bom:5.7.1 (*)
| | \--- org.apiguardian:apiguardian-api:1.1.0
| \--- org.junit.jupiter:junit-jupiter-params:5.7.1
| +--- org.junit:junit-bom:5.7.1 (*)
| +--- org.apiguardian:apiguardian-api:1.1.0
| \--- org.junit.jupiter:junit-jupiter-api:5.7.1 (*)
+--- org.mockito:mockito-core:3.6.28
| +--- net.bytebuddy:byte-buddy:1.10.18 -> 1.10.22
| +--- net.bytebuddy:byte-buddy-agent:1.10.18 -> 1.10.22
| \--- org.objenesis:objenesis:3.1
+--- org.mockito:mockito-junit-jupiter:3.6.28
| \--- org.mockito:mockito-core:3.6.28 (*)
+--- org.skyscreamer:jsonassert:1.5.0
| \--- com.vaadin.external.google:android-json:0.0.20131108.vaadin1
+--- org.springframework:spring-core:5.3.6 (*)
+--- org.springframework:spring-test:5.3.6
| \--- org.springframework:spring-core:5.3.6 (*)
\--- org.xmlunit:xmlunit-core:2.7.0
testCompileOnly - Compile only dependencies for source set 'test'. (n)
No dependencies
testImplementation - Implementation only dependencies for source set 'test'. (n)
\--- org.springframework.boot:spring-boot-starter-test (n)
testRuntimeClasspath - Runtime classpath of source set 'test'.
+--- com.newrelic.logging:logback:2.0
| +--- com.fasterxml.jackson.core:jackson-core:2.11.1 -> 2.11.4
| +--- ch.qos.logback:logback-core:1.2.0 -> 1.2.3
| +--- ch.qos.logback:logback-classic:1.2.0 -> 1.2.3
| | +--- ch.qos.logback:logback-core:1.2.3
| | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| \--- com.newrelic.agent.java:newrelic-api:5.6.0
+--- org.springframework.boot:spring-boot-starter-web -> 2.4.5
| +--- org.springframework.boot:spring-boot-starter:2.4.5
| | +--- org.springframework.boot:spring-boot:2.4.5
| | | +--- org.springframework:spring-core:5.3.6
| | | | \--- org.springframework:spring-jcl:5.3.6
| | | \--- org.springframework:spring-context:5.3.6
| | | +--- org.springframework:spring-aop:5.3.6
| | | | +--- org.springframework:spring-beans:5.3.6
| | | | | \--- org.springframework:spring-core:5.3.6 (*)
| | | | \--- org.springframework:spring-core:5.3.6 (*)
| | | +--- org.springframework:spring-beans:5.3.6 (*)
| | | +--- org.springframework:spring-core:5.3.6 (*)
| | | \--- org.springframework:spring-expression:5.3.6
| | | \--- org.springframework:spring-core:5.3.6 (*)
| | +--- org.springframework.boot:spring-boot-autoconfigure:2.4.5
| | | \--- org.springframework.boot:spring-boot:2.4.5 (*)
| | +--- org.springframework.boot:spring-boot-starter-logging:2.4.5
| | | +--- ch.qos.logback:logback-classic:1.2.3 (*)
| | | +--- org.apache.logging.log4j:log4j-to-slf4j:2.13.3
| | | | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | | \--- org.apache.logging.log4j:log4j-api:2.13.3
| | | \--- org.slf4j:jul-to-slf4j:1.7.30
| | | \--- org.slf4j:slf4j-api:1.7.30
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | +--- org.springframework:spring-core:5.3.6 (*)
| | \--- org.yaml:snakeyaml:1.27
| +--- org.springframework.boot:spring-boot-starter-json:2.4.5
| | +--- org.springframework.boot:spring-boot-starter:2.4.5 (*)
| | +--- org.springframework:spring-web:5.3.6
| | | +--- org.springframework:spring-beans:5.3.6 (*)
| | | \--- org.springframework:spring-core:5.3.6 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.4
| | | +--- com.fasterxml.jackson.core:jackson-core:2.11.4
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.4
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.4
| | | \--- com.fasterxml.jackson.core:jackson-core:2.11.4
| | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4
| +--- org.springframework.boot:spring-boot-starter-tomcat:2.4.5
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.45
| | +--- org.glassfish:jakarta.el:3.0.3
| | \--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.45
| | \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.45
| +--- org.springframework:spring-web:5.3.6 (*)
| \--- org.springframework:spring-webmvc:5.3.6
| +--- org.springframework:spring-aop:5.3.6 (*)
| +--- org.springframework:spring-beans:5.3.6 (*)
| +--- org.springframework:spring-context:5.3.6 (*)
| +--- org.springframework:spring-core:5.3.6 (*)
| +--- org.springframework:spring-expression:5.3.6 (*)
| \--- org.springframework:spring-web:5.3.6 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.4.5
| +--- org.springframework.boot:spring-boot-starter:2.4.5 (*)
| +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.4.5
| | +--- com.fasterxml.jackson.core:jackson-databind:2.11.4 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4 (*)
| | +--- org.springframework.boot:spring-boot-actuator:2.4.5
| | | \--- org.springframework.boot:spring-boot:2.4.5 (*)
| | +--- org.springframework.boot:spring-boot:2.4.5 (*)
| | \--- org.springframework.boot:spring-boot-autoconfigure:2.4.5 (*)
| \--- io.micrometer:micrometer-core:1.6.6
| +--- org.hdrhistogram:HdrHistogram:2.1.12
| \--- org.latencyutils:LatencyUtils:2.0.3
+--- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.12.2
| +--- com.fasterxml.jackson.core:jackson-core:2.12.2 -> 2.11.4
| +--- com.fasterxml.jackson.core:jackson-annotations:2.12.2 -> 2.11.4
| +--- com.fasterxml.jackson.core:jackson-databind:2.12.2 -> 2.11.4 (*)
| +--- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.2 -> 2.11.4
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.4
| | +--- com.fasterxml.jackson.core:jackson-core:2.11.4
| | +--- com.fasterxml.jackson.core:jackson-databind:2.11.4 (*)
| | +--- jakarta.xml.bind:jakarta.xml.bind-api:2.3.2 -> 2.3.3
| | | \--- jakarta.activation:jakarta.activation-api:1.2.2
| | \--- jakarta.activation:jakarta.activation-api:1.2.1 -> 1.2.2
| +--- org.codehaus.woodstox:stax2-api:4.2.1
| +--- com.fasterxml.woodstox:woodstox-core:6.2.4
| | \--- org.codehaus.woodstox:stax2-api:4.2.1
| \--- com.fasterxml.jackson:jackson-bom:2.12.2
| +--- com.fasterxml.jackson.core:jackson-annotations:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.core:jackson-core:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.core:jackson-databind:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.12.2 (c)
| +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.2 -> 2.11.4 (c)
| +--- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.2 -> 2.11.4 (c)
| \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.2 -> 2.11.4 (c)
+--- javax.xml.bind:jaxb-api:2.2.4
| +--- javax.xml.stream:stax-api:1.0-2
| \--- javax.activation:activation:1.1
\--- org.springframework.boot:spring-boot-starter-test -> 2.4.5
+--- org.springframework.boot:spring-boot-starter:2.4.5 (*)
+--- org.springframework.boot:spring-boot-test:2.4.5
| \--- org.springframework.boot:spring-boot:2.4.5 (*)
+--- org.springframework.boot:spring-boot-test-autoconfigure:2.4.5
| +--- org.springframework.boot:spring-boot:2.4.5 (*)
| +--- org.springframework.boot:spring-boot-test:2.4.5 (*)
| \--- org.springframework.boot:spring-boot-autoconfigure:2.4.5 (*)
+--- com.jayway.jsonpath:json-path:2.4.0
| +--- net.minidev:json-smart:2.3
| | \--- net.minidev:accessors-smart:1.2
| | \--- org.ow2.asm:asm:5.0.4
| \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
+--- jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 (*)
+--- org.assertj:assertj-core:3.18.1
+--- org.hamcrest:hamcrest:2.2
+--- org.junit.jupiter:junit-jupiter:5.7.1
| +--- org.junit:junit-bom:5.7.1
| | +--- org.junit.jupiter:junit-jupiter:5.7.1 (c)
| | +--- org.junit.jupiter:junit-jupiter-api:5.7.1 (c)
| | +--- org.junit.jupiter:junit-jupiter-engine:5.7.1 (c)
| | +--- org.junit.jupiter:junit-jupiter-params:5.7.1 (c)
| | +--- org.junit.platform:junit-platform-commons:1.7.1 (c)
| | \--- org.junit.platform:junit-platform-engine:1.7.1 (c)
| +--- org.junit.jupiter:junit-jupiter-api:5.7.1
| | +--- org.junit:junit-bom:5.7.1 (*)
| | +--- org.apiguardian:apiguardian-api:1.1.0
| | +--- org.opentest4j:opentest4j:1.2.0
| | \--- org.junit.platform:junit-platform-commons:1.7.1
| | +--- org.junit:junit-bom:5.7.1 (*)
| | \--- org.apiguardian:apiguardian-api:1.1.0
| +--- org.junit.jupiter:junit-jupiter-params:5.7.1
| | +--- org.junit:junit-bom:5.7.1 (*)
| | +--- org.apiguardian:apiguardian-api:1.1.0
| | \--- org.junit.jupiter:junit-jupiter-api:5.7.1 (*)
| \--- org.junit.jupiter:junit-jupiter-engine:5.7.1
| +--- org.junit:junit-bom:5.7.1 (*)
| +--- org.apiguardian:apiguardian-api:1.1.0
| +--- org.junit.platform:junit-platform-engine:1.7.1
| | +--- org.junit:junit-bom:5.7.1 (*)
| | +--- org.apiguardian:apiguardian-api:1.1.0
| | +--- org.opentest4j:opentest4j:1.2.0
| | \--- org.junit.platform:junit-platform-commons:1.7.1 (*)
| \--- org.junit.jupiter:junit-jupiter-api:5.7.1 (*)
+--- org.mockito:mockito-core:3.6.28
| +--- net.bytebuddy:byte-buddy:1.10.18 -> 1.10.22
| +--- net.bytebuddy:byte-buddy-agent:1.10.18 -> 1.10.22
| \--- org.objenesis:objenesis:3.1
+--- org.mockito:mockito-junit-jupiter:3.6.28
| +--- org.mockito:mockito-core:3.6.28 (*)
| \--- org.junit.jupiter:junit-jupiter-api:5.4.2 -> 5.7.1 (*)
+--- org.skyscreamer:jsonassert:1.5.0
| \--- com.vaadin.external.google:android-json:0.0.20131108.vaadin1
+--- org.springframework:spring-core:5.3.6 (*)
+--- org.springframework:spring-test:5.3.6
| \--- org.springframework:spring-core:5.3.6 (*)
\--- org.xmlunit:xmlunit-core:2.7.0
Error while running the boot app -
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(XmlMapper.java:175)
The following method did not exist:
'com.fasterxml.jackson.databind.cfg.MutableCoercionConfig com.fasterxml.jackson.dataformat.xml.XmlMapper.coercionConfigDefaults()'
The method's class, com.fasterxml.jackson.dataformat.xml.XmlMapper, is available from the following locations:
jar:file:/C:/Users/user1/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.12.2/dac1d21b5fe602d492273d35eb28918a91fc5412/jackson-dataformat-xml-2.12.2.jar!/com/fasterxml/jackson/dataformat/xml/XmlMapper.class
The class hierarchy was loaded from the following locations:
com.fasterxml.jackson.dataformat.xml.XmlMapper: file:/C:/Users/user1/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.12.2/dac1d21b5fe602d492273d35eb28918a91fc5412/jackson-dataformat-xml-2.12.2.jar
com.fasterxml.jackson.databind.ObjectMapper: file:/C:/Users/user1/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.11.4/5d9f3d441f99d721b957e3497f0a6465c764fad4/jackson-databind-2.11.4.jar
com.fasterxml.jackson.core.ObjectCodec: file:/C:/Users/user1/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.11.4/593f7b18bab07a76767f181e2a2336135ce82cc4/jackson-core-2.11.4.jar
com.fasterxml.jackson.core.TreeCodec: file:/C:/Users/user1/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.11.4/593f7b18bab07a76767f181e2a2336135ce82cc4/jackson-core-2.11.4.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.fasterxml.jackson.dataformat.xml.XmlMapper
Do you explicitly need version 2.12.2 of jackson-dataformat-xml?
Problem
jackson-dataformat-xml:2.12.2 is not compatible with jackson dependencies 2.11.4. Spring Boot overwrites Jackson dependencies that are not specified other way in dependencies block or in dependencyManagement.
Solution
If you don't need 2.12.2 then just define the jackson-dataformat-xml as following:
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml'
then resolved version will be
com.fasterxml.jackson.dataformat:jackson-dataformat-xml -> 2.11.4
which will be compatible with all other Jackson components and you will not be getting this exception anymore. Always try to check the dependencies of Jackson and make sure all are aligned.
You see for example if you run 'gradlew dependencies' and you get following result it's bad:
+--- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.12.2
| +--- com.fasterxml.jackson.core:jackson-core:2.12.2 -> 2.11.4
versions of Jackson are not properly aligned. With managing Gradle dependencies you have to make sure you aligne them, that means upgrading or downgrading them.
If you really need explicitly 2.12.2 then you should also upgrade Spring Boot version which contains newer version.
You can specify version of Spring Boot in following way:
dependencyManagement {
imports {
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.5.0'
}
}
Why would you call whole dataformat library when you only need XMLMapper?
I found this workaround using Spring, as I only needed XMLMapper:
Get a reference to the message converter, in declarations:
private final MappingJackson2XmlHttpMessageConverter msgConverter;
and later just refer to it from it's parent: ObjectMapper
ObjectMapper xmlMapper = xmlConverter.getObjectMapper();
In that way you shouldn't get into the described dependency issue.
So, you only need to import com.fasterxml.jackson.databind.ObjectMapper

How to get Spring Cloud Config dependencies to resolve from parent configuration in Gradle multi-module build?

In an effort to put together an example project for Spring Cloud Config server and (Java and non-Java) clients using Vault, I decided to go the route of a multi-module Gradle build. Since I already had two working Java projects (server and client), I figured that I could pull the common configuration up into the parent build.gradle and conditionally apply the configuration for the Java subprojects. I started with the server subproject, and ran into an issue that I've been unable to resolve.
The build.gradle for the parent module looks like:
plugins {
id 'org.springframework.boot' version '2.3.0.RELEASE' apply false
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
id 'idea'
}
ext {
set('springCloudVersion', "Hoxton.SR4")
}
allprojects {
repositories {
mavenCentral()
}
version = '0.0.1-SNAPSHOT'
}
subprojects {
// We'll need dependencies for Docker and Docker compose
afterEvaluate { project ->
if (project.usesSpringBoot) {
println("Configuring ${springCloudVersion}")
configure(project) {
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java'
group = 'com.daecabhir'
sourceCompatibility = '11'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
test {
useJUnitPlatform()
}
}
}
}
}
and the build.gradle for the cloud-config-server subproject looks like:
ext {
usesSpringBoot = true
}
Unfortunately attempting a ./gradlew build leaves me with an error that it cannot find a class from Spring Cloud Config:
/home/gwright/projects/cloud-config-vault-example/cloud-config-server/src/main/java/com/daecabhir/cloudconfigserver/CloudConfigServerApplication.java:5: error: package org.springframework.cloud.config.server does not exist
import org.springframework.cloud.config.server.EnableConfigServer;
^
/home/gwright/projects/cloud-config-vault-example/cloud-config-server/src/main/java/com/daecabhir/cloudconfigserver/CloudConfigServerApplication.java:7: error: cannot find symbol
#EnableConfigServer
^
symbol: class EnableConfigServer
2 errors
When I check the dependencies, I get the following for compile time:
compileClasspath - Compile classpath for source set 'main'.
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.3.0.RELEASE
| +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE
| | +--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (c)
| | +--- io.micrometer:micrometer-core:1.5.1 (c)
| | +--- org.springframework:spring-web:5.2.6.RELEASE (c)
| | +--- org.springframework:spring-webmvc:5.2.6.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-actuator:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-json:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-tomcat:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-web:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-autoconfigure:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-logging:2.3.0.RELEASE (c)
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5 (c)
| | +--- org.springframework:spring-core:5.2.6.RELEASE (c)
| | +--- org.yaml:snakeyaml:1.26 (c)
| | +--- org.springframework.boot:spring-boot-actuator:2.3.0.RELEASE (c)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0 (c)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0 (c)
| | +--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.0 (c)
| | +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.35 (c)
| | +--- org.glassfish:jakarta.el:3.0.3 (c)
| | +--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.35 (c)
| | +--- org.springframework:spring-beans:5.2.6.RELEASE (c)
| | +--- org.springframework:spring-aop:5.2.6.RELEASE (c)
| | +--- org.springframework:spring-context:5.2.6.RELEASE (c)
| | +--- org.springframework:spring-expression:5.2.6.RELEASE (c)
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.0 (c)
| | +--- com.fasterxml.jackson.core:jackson-core:2.11.0 (c)
| | +--- ch.qos.logback:logback-classic:1.2.3 (c)
| | +--- org.apache.logging.log4j:log4j-to-slf4j:2.13.2 (c)
| | +--- org.slf4j:jul-to-slf4j:1.7.30 (c)
| | +--- org.springframework:spring-jcl:5.2.6.RELEASE (c)
| | +--- org.springframework.security:spring-security-crypto:5.3.2.RELEASE (c)
| | +--- ch.qos.logback:logback-core:1.2.3 (c)
| | +--- org.slf4j:slf4j-api:1.7.30 (c)
| | \--- org.apache.logging.log4j:log4j-api:2.13.2 (c)
| +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE
| | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | +--- org.springframework.boot:spring-boot:2.3.0.RELEASE
| | | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | | +--- org.springframework:spring-core -> 5.2.6.RELEASE
| | | | \--- org.springframework:spring-jcl:5.2.6.RELEASE
| | | \--- org.springframework:spring-context -> 5.2.6.RELEASE
| | | +--- org.springframework:spring-aop:5.2.6.RELEASE
| | | | +--- org.springframework:spring-beans:5.2.6.RELEASE
| | | | | \--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | | | \--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | | +--- org.springframework:spring-beans:5.2.6.RELEASE (*)
| | | +--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | | \--- org.springframework:spring-expression:5.2.6.RELEASE
| | | \--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-autoconfigure:2.3.0.RELEASE
| | | +--- org.springframework.boot:spring-boot:2.3.0.RELEASE (*)
| | | \--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-starter-logging:2.3.0.RELEASE
| | | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | | +--- ch.qos.logback:logback-classic -> 1.2.3
| | | | +--- ch.qos.logback:logback-core:1.2.3
| | | | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | +--- org.apache.logging.log4j:log4j-to-slf4j -> 2.13.2
| | | | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | | \--- org.apache.logging.log4j:log4j-api:2.13.2
| | | \--- org.slf4j:jul-to-slf4j -> 1.7.30
| | | \--- org.slf4j:slf4j-api:1.7.30
| | +--- jakarta.annotation:jakarta.annotation-api -> 1.3.5
| | +--- org.springframework:spring-core -> 5.2.6.RELEASE (*)
| | \--- org.yaml:snakeyaml -> 1.26
| +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.0.RELEASE
| | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | \--- org.springframework.boot:spring-boot-actuator:2.3.0.RELEASE
| | \--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| \--- io.micrometer:micrometer-core -> 1.5.1
| \--- org.hdrhistogram:HdrHistogram:2.1.12
+--- org.springframework.boot:spring-boot-starter-web -> 2.3.0.RELEASE
| +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE (*)
| +--- org.springframework.boot:spring-boot-starter-json:2.3.0.RELEASE
| | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE (*)
| | +--- org.springframework:spring-web -> 5.2.6.RELEASE
| | | +--- org.springframework:spring-beans:5.2.6.RELEASE (*)
| | | \--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | +--- com.fasterxml.jackson.core:jackson-databind -> 2.11.0
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.0
| | | \--- com.fasterxml.jackson.core:jackson-core:2.11.0
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8 -> 2.11.0
| | | +--- com.fasterxml.jackson.core:jackson-core:2.11.0
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310 -> 2.11.0
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.0
| | | +--- com.fasterxml.jackson.core:jackson-core:2.11.0
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (*)
| | \--- com.fasterxml.jackson.module:jackson-module-parameter-names -> 2.11.0
| | +--- com.fasterxml.jackson.core:jackson-core:2.11.0
| | \--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (*)
| +--- org.springframework.boot:spring-boot-starter-tomcat:2.3.0.RELEASE
| | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | +--- jakarta.annotation:jakarta.annotation-api -> 1.3.5
| | +--- org.apache.tomcat.embed:tomcat-embed-core -> 9.0.35
| | +--- org.glassfish:jakarta.el -> 3.0.3
| | \--- org.apache.tomcat.embed:tomcat-embed-websocket -> 9.0.35
| | \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.35
| +--- org.springframework:spring-web -> 5.2.6.RELEASE (*)
| \--- org.springframework:spring-webmvc -> 5.2.6.RELEASE
| +--- org.springframework:spring-aop:5.2.6.RELEASE (*)
| +--- org.springframework:spring-beans:5.2.6.RELEASE (*)
| +--- org.springframework:spring-context:5.2.6.RELEASE (*)
| +--- org.springframework:spring-core:5.2.6.RELEASE (*)
| +--- org.springframework:spring-expression:5.2.6.RELEASE (*)
| \--- org.springframework:spring-web:5.2.6.RELEASE (*)
\--- org.springframework.cloud:spring-cloud-starter-config -> 2.2.2.RELEASE
+--- org.springframework.cloud:spring-cloud-starter:2.2.2.RELEASE
| +--- org.springframework.boot:spring-boot-starter:2.2.5.RELEASE -> 2.3.0.RELEASE (*)
| +--- org.springframework.cloud:spring-cloud-context:2.2.2.RELEASE
| | \--- org.springframework.security:spring-security-crypto:5.2.2.RELEASE -> 5.3.2.RELEASE
| +--- org.springframework.cloud:spring-cloud-commons:2.2.2.RELEASE
| | \--- org.springframework.security:spring-security-crypto:5.2.2.RELEASE -> 5.3.2.RELEASE
| \--- org.springframework.security:spring-security-rsa:1.0.9.RELEASE
| \--- org.bouncycastle:bcpkix-jdk15on:1.64
| \--- org.bouncycastle:bcprov-jdk15on:1.64
+--- org.springframework.cloud:spring-cloud-config-client:2.2.2.RELEASE
| +--- org.springframework.boot:spring-boot-autoconfigure:2.2.5.RELEASE -> 2.3.0.RELEASE (*)
| +--- org.springframework.cloud:spring-cloud-commons:2.2.2.RELEASE (*)
| +--- org.springframework.cloud:spring-cloud-context:2.2.2.RELEASE (*)
| +--- org.springframework:spring-web:5.2.4.RELEASE -> 5.2.6.RELEASE (*)
| +--- com.fasterxml.jackson.core:jackson-annotations:2.10.2 -> 2.11.0
| \--- com.fasterxml.jackson.core:jackson-databind:2.10.2 -> 2.11.0 (*)
\--- com.fasterxml.jackson.core:jackson-databind:2.10.2 -> 2.11.0 (*)
which on the face of it looks reasonable, except that it isn't. It seems that Gradle is honoring the dependencies, but they are not getting fully resolved by dependency management. When I fall back to fully specifying the configuration in the cloud-config-server subproject using the following parent build.gradle:
plugins {
id 'org.springframework.boot' version '2.3.0.RELEASE' apply false
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
id 'idea'
}
ext {
set('springCloudVersion', "Hoxton.SR4")
}
allprojects {
repositories {
mavenCentral()
}
version = '0.0.1-SNAPSHOT'
}
and a subproject build.gradle of:
plugins {
id 'org.springframework.boot'
id 'io.spring.dependency-management'
id 'java'
}
group = 'com.daecabhir'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-config-server'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
test {
useJUnitPlatform()
}
the build works fine, and the dependencies are more fully "resolved" (the spring-cloud-config-server dependency in particular):
compileClasspath - Compile classpath for source set 'main'.
+--- org.springframework.boot:spring-boot-starter-web -> 2.3.0.RELEASE
| +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE
| | +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.0 (c)
| | +--- org.springframework:spring-web:5.2.6.RELEASE (c)
| | +--- org.springframework:spring-webmvc:5.2.6.RELEASE (c)
| | +--- org.springframework.security:spring-security-crypto:5.3.2.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-actuator:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-json:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-tomcat:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-validation:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-web:2.3.0.RELEASE (c)
| | +--- org.yaml:snakeyaml:1.26 (c)
| | +--- org.springframework.boot:spring-boot:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-autoconfigure:2.3.0.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-starter-logging:2.3.0.RELEASE (c)
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5 (c)
| | +--- org.springframework:spring-core:5.2.6.RELEASE (c)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (c)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0 (c)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0 (c)
| | +--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.0 (c)
| | +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.35 (c)
| | +--- org.glassfish:jakarta.el:3.0.3 (c)
| | +--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.35 (c)
| | +--- org.springframework:spring-beans:5.2.6.RELEASE (c)
| | +--- org.springframework:spring-aop:5.2.6.RELEASE (c)
| | +--- org.springframework:spring-context:5.2.6.RELEASE (c)
| | +--- org.springframework:spring-expression:5.2.6.RELEASE (c)
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.0 (c)
| | +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.0.RELEASE (c)
| | +--- io.micrometer:micrometer-core:1.5.1 (c)
| | +--- org.hibernate.validator:hibernate-validator:6.1.5.Final (c)
| | +--- org.slf4j:slf4j-api:1.7.30 (c)
| | +--- org.apache.httpcomponents:httpclient:4.5.12 (c)
| | +--- org.apache.httpcomponents:httpcore:4.4.13 (c)
| | +--- com.fasterxml.jackson.core:jackson-core:2.11.0 (c)
| | +--- ch.qos.logback:logback-classic:1.2.3 (c)
| | +--- org.apache.logging.log4j:log4j-to-slf4j:2.13.2 (c)
| | +--- org.slf4j:jul-to-slf4j:1.7.30 (c)
| | +--- org.springframework:spring-jcl:5.2.6.RELEASE (c)
| | +--- org.springframework.boot:spring-boot-actuator:2.3.0.RELEASE (c)
| | +--- jakarta.validation:jakarta.validation-api:2.0.2 (c)
| | +--- org.jboss.logging:jboss-logging:3.4.1.Final (c)
| | +--- com.fasterxml:classmate:1.5.1 (c)
| | +--- commons-codec:commons-codec:1.14 (c)
| | +--- ch.qos.logback:logback-core:1.2.3 (c)
| | \--- org.apache.logging.log4j:log4j-api:2.13.2 (c)
| +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE
| | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | +--- org.springframework.boot:spring-boot:2.3.0.RELEASE
| | | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | | +--- org.springframework:spring-core -> 5.2.6.RELEASE
| | | | \--- org.springframework:spring-jcl:5.2.6.RELEASE
| | | \--- org.springframework:spring-context -> 5.2.6.RELEASE
| | | +--- org.springframework:spring-aop:5.2.6.RELEASE
| | | | +--- org.springframework:spring-beans:5.2.6.RELEASE
| | | | | \--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | | | \--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | | +--- org.springframework:spring-beans:5.2.6.RELEASE (*)
| | | +--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | | \--- org.springframework:spring-expression:5.2.6.RELEASE
| | | \--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-autoconfigure:2.3.0.RELEASE
| | | +--- org.springframework.boot:spring-boot:2.3.0.RELEASE (*)
| | | \--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-starter-logging:2.3.0.RELEASE
| | | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | | +--- ch.qos.logback:logback-classic -> 1.2.3
| | | | +--- ch.qos.logback:logback-core:1.2.3
| | | | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | +--- org.apache.logging.log4j:log4j-to-slf4j -> 2.13.2
| | | | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | | \--- org.apache.logging.log4j:log4j-api:2.13.2
| | | \--- org.slf4j:jul-to-slf4j -> 1.7.30
| | | \--- org.slf4j:slf4j-api:1.7.30
| | +--- jakarta.annotation:jakarta.annotation-api -> 1.3.5
| | +--- org.springframework:spring-core -> 5.2.6.RELEASE (*)
| | \--- org.yaml:snakeyaml -> 1.26
| +--- org.springframework.boot:spring-boot-starter-json:2.3.0.RELEASE
| | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE (*)
| | +--- org.springframework:spring-web -> 5.2.6.RELEASE
| | | +--- org.springframework:spring-beans:5.2.6.RELEASE (*)
| | | \--- org.springframework:spring-core:5.2.6.RELEASE (*)
| | +--- com.fasterxml.jackson.core:jackson-databind -> 2.11.0
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.0
| | | \--- com.fasterxml.jackson.core:jackson-core:2.11.0
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8 -> 2.11.0
| | | +--- com.fasterxml.jackson.core:jackson-core:2.11.0
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310 -> 2.11.0
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.11.0
| | | +--- com.fasterxml.jackson.core:jackson-core:2.11.0
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (*)
| | \--- com.fasterxml.jackson.module:jackson-module-parameter-names -> 2.11.0
| | +--- com.fasterxml.jackson.core:jackson-core:2.11.0
| | \--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (*)
| +--- org.springframework.boot:spring-boot-starter-tomcat:2.3.0.RELEASE
| | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | +--- jakarta.annotation:jakarta.annotation-api -> 1.3.5
| | +--- org.apache.tomcat.embed:tomcat-embed-core -> 9.0.35
| | +--- org.glassfish:jakarta.el -> 3.0.3
| | \--- org.apache.tomcat.embed:tomcat-embed-websocket -> 9.0.35
| | \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.35
| +--- org.springframework:spring-web -> 5.2.6.RELEASE (*)
| \--- org.springframework:spring-webmvc -> 5.2.6.RELEASE
| +--- org.springframework:spring-aop:5.2.6.RELEASE (*)
| +--- org.springframework:spring-beans:5.2.6.RELEASE (*)
| +--- org.springframework:spring-context:5.2.6.RELEASE (*)
| +--- org.springframework:spring-core:5.2.6.RELEASE (*)
| +--- org.springframework:spring-expression:5.2.6.RELEASE (*)
| \--- org.springframework:spring-web:5.2.6.RELEASE (*)
\--- org.springframework.cloud:spring-cloud-config-server -> 2.2.2.RELEASE
+--- org.springframework.cloud:spring-cloud-config-client:2.2.2.RELEASE
| +--- org.springframework.boot:spring-boot-autoconfigure:2.2.5.RELEASE -> 2.3.0.RELEASE (*)
| +--- org.springframework.cloud:spring-cloud-commons:2.2.2.RELEASE
| | \--- org.springframework.security:spring-security-crypto:5.2.2.RELEASE -> 5.3.2.RELEASE
| +--- org.springframework.cloud:spring-cloud-context:2.2.2.RELEASE
| | \--- org.springframework.security:spring-security-crypto:5.2.2.RELEASE -> 5.3.2.RELEASE
| +--- org.springframework:spring-web:5.2.4.RELEASE -> 5.2.6.RELEASE (*)
| +--- com.fasterxml.jackson.core:jackson-annotations:2.10.2 -> 2.11.0
| \--- com.fasterxml.jackson.core:jackson-databind:2.10.2 -> 2.11.0 (*)
+--- org.springframework.boot:spring-boot-starter-actuator:2.2.5.RELEASE -> 2.3.0.RELEASE
| +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE (*)
| +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.0.RELEASE
| | +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| | \--- org.springframework.boot:spring-boot-actuator:2.3.0.RELEASE
| | \--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| \--- io.micrometer:micrometer-core -> 1.5.1
| \--- org.hdrhistogram:HdrHistogram:2.1.12
+--- org.springframework.boot:spring-boot-starter-web:2.2.5.RELEASE -> 2.3.0.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-validation:2.2.5.RELEASE -> 2.3.0.RELEASE
| +--- org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE (*)
| +--- org.springframework.boot:spring-boot-starter:2.3.0.RELEASE (*)
| +--- org.glassfish:jakarta.el -> 3.0.3
| \--- org.hibernate.validator:hibernate-validator -> 6.1.5.Final
| +--- jakarta.validation:jakarta.validation-api:2.0.2
| +--- org.jboss.logging:jboss-logging:3.3.2.Final -> 3.4.1.Final
| \--- com.fasterxml:classmate:1.3.4 -> 1.5.1
+--- org.springframework.security:spring-security-crypto:5.2.2.RELEASE -> 5.3.2.RELEASE
+--- org.springframework.security:spring-security-rsa:1.0.9.RELEASE
| \--- org.bouncycastle:bcpkix-jdk15on:1.64
| \--- org.bouncycastle:bcprov-jdk15on:1.64
+--- org.eclipse.jgit:org.eclipse.jgit:5.1.3.201810200350-r
| +--- com.jcraft:jsch:0.1.54
| +--- com.jcraft:jzlib:1.1.1
| +--- com.googlecode.javaewah:JavaEWAH:1.1.6
| \--- org.slf4j:slf4j-api:1.7.2 -> 1.7.30
+--- org.eclipse.jgit:org.eclipse.jgit.http.apache:5.1.3.201810200350-r
| +--- org.eclipse.jgit:org.eclipse.jgit:5.1.3.201810200350-r (*)
| +--- org.apache.httpcomponents:httpclient:4.5.5 -> 4.5.12
| | +--- org.apache.httpcomponents:httpcore:4.4.13
| | \--- commons-codec:commons-codec:1.11 -> 1.14
| \--- org.apache.httpcomponents:httpcore:4.4.9 -> 4.4.13
+--- org.yaml:snakeyaml:1.25 -> 1.26
\--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.10.2 -> 2.11.0
+--- com.fasterxml.jackson.core:jackson-databind:2.11.0 (*)
+--- org.yaml:snakeyaml:1.26
\--- com.fasterxml.jackson.core:jackson-core:2.11.0
So my question is, what do I need to do in order to be able to specify the configuration in the parent project selectively based on a property so that the dependencies will be fully resolved? And what is it about how I specified the configuration that is causing it to not fully resolve the dependencies?
FWIW, the full code for the project can be found here:
Using parent configuration, not working: https://github.com/daecabhir/cloud-config-vault-example/tree/feat/multi-module-java-builds
Using explicit subproject configuration, working: https://github.com/daecabhir/cloud-config-vault-example/tree/feat/multi-module-java-build-working
I've made a PR to your repo: https://github.com/daecabhir/cloud-config-vault-example/pull/3
Rather than using a property to control if a project is a Spring Boot project (didn't work for me), you can define a list of projects that are Spring Boot based projects, then apply defaults which you have done.
plugins {
id 'org.springframework.boot' version '2.3.0.RELEASE' apply false
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
id 'idea'
}
ext {
set('springCloudVersion', "Hoxton.SR4")
}
allprojects {
repositories {
mavenCentral()
}
version = '0.0.1-SNAPSHOT'
}
// List of Spring Boot based projects
def springBootProjects = [
project(":cloud-config-server"),
project(":cloud-config-client")
]
Once you have your list, then simply iterate over them, applying based configuration to them:
springBootProjects.each { springBootProject ->
configure(springBootProject) {
println("Configuring $name as a Spring Boot project")
apply {
plugin("org.springframework.boot")
plugin("io.spring.dependency-management")
plugin("java")
}
group = "com.daecabhir"
sourceCompatibility = "11"
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
tasks {
test {
useJUnitPlatform()
}
}
}
}
You had spring-cloud-starter-config as an import for the server application, but that is incorrect because the spring-cloud-starter-config module brings in spring-cloud-config-client which is not what is needed for a config server as it leads to import issues.
So rather than defining the dependency there as a base dependency, move it to the project itself:
cloud-config-server/build.gradle
dependencies {
implementation "org.springframework.cloud:spring-cloud-config-server"
}
cloud-config-client/build.gradle
dependencies {
implementation "org.springframework.cloud:spring-cloud-starter-config"
}
With these changes, the resulting output is:
$ ./gradlew assemble
> Configure project :
Configuring cloud-config-server as a Spring Boot project
Configuring cloud-config-client as a Spring Boot project
BUILD SUCCESSFUL in 2s
6 actionable tasks: 6 up-to-date

Spring-data-Jpa and Hibernate-entitimanager dependency conflict in gradle project

I have a gradle project. I am new to gradle and converted one of my project to gradle. My project was working then it started me giving error. Then I noticed that if I comment out my Hibernate-entitymanger dependency, then no error.
Here is my build.gradle snippet
apply plugin: 'application' // implicitly apply java and distribution plugin
apply plugin: 'eclipse'
apply plugin: 'project-report'
repositories {
mavenCentral()
mavenLocal()
}
ext {
//Spring
springFrameworkGroupId = "org.springframework"
springFrameworkVersion = "4.2.4.RELEASE"
springDataJpaVersion = "1.9.2.RELEASE"
//Hibernate
hibernateEntityManagerVersion = "5.1.0.Final"
hibernateValidatorVersion = "5.2.3.Final"
sqlJdbc4Version = "4.0"
....
}
dependencies {
compile group: log4jGroupId, name: 'log4j-api', version: log4jVersion
compile group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
['spring-context-support', 'spring-jdbc', 'spring-oxm', 'spring-orm', 'spring-jms', 'spring-test'].each {
compile "$springFrameworkGroupId:$it:$springFrameworkVersion"
}
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: springDataJpaVersion
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: hibernateEntityManagerVersion
compile group: 'com.microsoft.sqlserver', name: 'sqljdbc4', version: sqlJdbc4Version
....
}
I am simply doing
try (GenericApplicationContext springRootContext = new AnnotationConfigApplicationContext(RootContext.class)) { //error
BatchImportRequestService batchImportRequestService = springRootContext.getBean(BatchImportRequestServiceImpl.class);
batchImportRequestService.handleRequest(springRootContext, args);
} catch (Exception e) {
logger.error("Exception occurs in loading Spring root context: ", e);
}
When I do this it gives me error that
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/basit.ahmed/.gradle/caches/modules-2/files-2.1/org.apache.activemq/activemq-all/5.13.0/4dc8405e5e52a05197e4e91d0e46b353107bcfe0/activemq-all-5.13.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/basit.ahmed/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.5/d1e34a4525e08873703fdaad6c6284f944f8ca8f/log4j-slf4j-impl-2.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.doWithLocalFields(Ljava/lang/Class;Lorg/springframework/util/ReflectionUtils$FieldCallback;)V
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.buildPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:413)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:392)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:929)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
....
But if comment out my hibernate-entitymaanger dependency, then it stats working. Like
compile group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
['spring-context-support', 'spring-jdbc', 'spring-oxm', 'spring-orm', 'spring-jms', 'spring-test'].each {
compile "$springFrameworkGroupId:$it:$springFrameworkVersion"
}
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: springDataJpaVersion
//compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: hibernateEntityManagerVersion
...
I also run dependency-tree task. Here what I got
compile - Compile classpath for source set 'main'.
...
+--- org.springframework:spring-test:4.2.4.RELEASE
| \--- org.springframework:spring-core:4.2.4.RELEASE (*)
+--- org.springframework.data:spring-data-jpa:1.9.2.RELEASE
| +--- org.springframework.data:spring-data-commons:1.11.2.RELEASE
| | +--- org.springframework:spring-core:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| | +--- org.springframework:spring-beans:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| | +--- org.slf4j:slf4j-api:1.7.13
| | \--- org.slf4j:jcl-over-slf4j:1.7.13
| | \--- org.slf4j:slf4j-api:1.7.13
| +--- org.springframework:spring-orm:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-context:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-aop:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-tx:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-core:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.aspectj:aspectjrt:1.8.7
| +--- org.slf4j:slf4j-api:1.7.13
| \--- org.slf4j:jcl-over-slf4j:1.7.13 (*)
+--- org.hibernate:hibernate-entitymanager:5.1.0.Final
| +--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- org.hibernate:hibernate-core:5.1.0.Final
| | +--- org.jboss.logging:jboss-logging:3.3.0.Final
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.javassist:javassist:3.20.0-GA
| | +--- antlr:antlr:2.7.7
| | +--- org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
| | +--- org.jboss:jandex:2.0.0.Final
| | +--- com.fasterxml:classmate:1.3.0
| | +--- dom4j:dom4j:1.6.1
| | | \--- xml-apis:xml-apis:1.0.b2
| | \--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
| | \--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- dom4j:dom4j:1.6.1 (*)
| +--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final (*)
| +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.javassist:javassist:3.20.0-GA
| \--- org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
+--- com.microsoft.sqlserver:sqljdbc4:4.0
default - Configuration for default artifacts.
+--- org.springframework.data:spring-data-jpa:1.9.2.RELEASE
| +--- org.springframework.data:spring-data-commons:1.11.2.RELEASE
| | +--- org.springframework:spring-core:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| | +--- org.springframework:spring-beans:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| | +--- org.slf4j:slf4j-api:1.7.13
| | \--- org.slf4j:jcl-over-slf4j:1.7.13
| | \--- org.slf4j:slf4j-api:1.7.13
| +--- org.springframework:spring-orm:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-context:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-aop:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-tx:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-core:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.aspectj:aspectjrt:1.8.7
| +--- org.slf4j:slf4j-api:1.7.13
| \--- org.slf4j:jcl-over-slf4j:1.7.13 (*)
+--- org.hibernate:hibernate-entitymanager:5.1.0.Final
| +--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- org.hibernate:hibernate-core:5.1.0.Final
| | +--- org.jboss.logging:jboss-logging:3.3.0.Final
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.javassist:javassist:3.20.0-GA
| | +--- antlr:antlr:2.7.7
| | +--- org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
| | +--- org.jboss:jandex:2.0.0.Final
| | +--- com.fasterxml:classmate:1.3.0
| | +--- dom4j:dom4j:1.6.1
| | | \--- xml-apis:xml-apis:1.0.b2
| | \--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
| | \--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- dom4j:dom4j:1.6.1 (*)
| +--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final (*)
| +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.javassist:javassist:3.20.0-GA
| \--- org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
+--- com.microsoft.sqlserver:sqljdbc4:4.0
runtime - Runtime classpath for source set 'main'.
+--- org.springframework.data:spring-data-jpa:1.9.2.RELEASE
| +--- org.springframework.data:spring-data-commons:1.11.2.RELEASE
| | +--- org.springframework:spring-core:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| | +--- org.springframework:spring-beans:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| | +--- org.slf4j:slf4j-api:1.7.13
| | \--- org.slf4j:jcl-over-slf4j:1.7.13
| | \--- org.slf4j:slf4j-api:1.7.13
| +--- org.springframework:spring-orm:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-context:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-aop:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-tx:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.springframework:spring-core:4.1.9.RELEASE -> 4.2.4.RELEASE (*)
| +--- org.aspectj:aspectjrt:1.8.7
| +--- org.slf4j:slf4j-api:1.7.13
| \--- org.slf4j:jcl-over-slf4j:1.7.13 (*)
+--- org.hibernate:hibernate-entitymanager:5.1.0.Final
| +--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- org.hibernate:hibernate-core:5.1.0.Final
| | +--- org.jboss.logging:jboss-logging:3.3.0.Final
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.javassist:javassist:3.20.0-GA
| | +--- antlr:antlr:2.7.7
| | +--- org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
| | +--- org.jboss:jandex:2.0.0.Final
| | +--- com.fasterxml:classmate:1.3.0
| | +--- dom4j:dom4j:1.6.1
| | | \--- xml-apis:xml-apis:1.0.b2
| | \--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
| | \--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- dom4j:dom4j:1.6.1 (*)
| +--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final (*)
| +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.javassist:javassist:3.20.0-GA
| \--- org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
+--- com.microsoft.sqlserver:sqljdbc4:4.0
How can I solve this issue ? Why I am getting error in case of Hibernate-entitymanger inclusion ?
Thanks

Where can I find the document for `(*)` and `1.7.6 -> 1.7.7` in the output of `gradle dependencies`

For a gradle project with simple build.gradle file:
apply plugin: 'java'
repositories.jcenter()
dependencies {
compile "org.springframework.boot:spring-boot-starter-web:1.1.5.RELEASE"
compile 'org.slf4j:slf4j-api:1.7.1'
}
When I run gradle dependencies, it will show:
:dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
archives - Configuration for archive artifacts.
No dependencies
compile - Compile classpath for source set 'main'.
+--- org.springframework.boot:spring-boot-starter-web:1.1.5.RELEASE
| +--- org.springframework.boot:spring-boot-starter:1.1.5.RELEASE
| | +--- org.springframework.boot:spring-boot:1.1.5.RELEASE
| | | +--- org.springframework:spring-core:4.0.6.RELEASE
| | | | \--- commons-logging:commons-logging:1.1.3
| | | \--- org.springframework:spring-context:4.0.6.RELEASE
| | | +--- org.springframework:spring-aop:4.0.6.RELEASE
| | | | +--- aopalliance:aopalliance:1.0
| | | | +--- org.springframework:spring-beans:4.0.6.RELEASE
| | | | | \--- org.springframework:spring-core:4.0.6.RELEASE (*)
| | | | \--- org.springframework:spring-core:4.0.6.RELEASE (*)
| | | +--- org.springframework:spring-beans:4.0.6.RELEASE (*)
| | | +--- org.springframework:spring-core:4.0.6.RELEASE (*)
| | | \--- org.springframework:spring-expression:4.0.6.RELEASE
| | | \--- org.springframework:spring-core:4.0.6.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-autoconfigure:1.1.5.RELEASE
| | | \--- org.springframework.boot:spring-boot:1.1.5.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-starter-logging:1.1.5.RELEASE
| | | +--- org.slf4j:jcl-over-slf4j:1.7.7
| | | | \--- org.slf4j:slf4j-api:1.7.7
| | | +--- org.slf4j:jul-to-slf4j:1.7.7
| | | | \--- org.slf4j:slf4j-api:1.7.7
| | | +--- org.slf4j:log4j-over-slf4j:1.7.7
| | | | \--- org.slf4j:slf4j-api:1.7.7
| | | \--- ch.qos.logback:logback-classic:1.1.2
| | | +--- ch.qos.logback:logback-core:1.1.2
| | | \--- org.slf4j:slf4j-api:1.7.6 -> 1.7.7
| | +--- org.springframework:spring-core:4.0.6.RELEASE (*)
| | \--- org.yaml:snakeyaml:1.13
| +--- org.springframework.boot:spring-boot-starter-tomcat:1.1.5.RELEASE
| | +--- org.apache.tomcat.embed:tomcat-embed-core:7.0.54
| | +--- org.apache.tomcat.embed:tomcat-embed-el:7.0.54
| | \--- org.apache.tomcat.embed:tomcat-embed-logging-juli:7.0.54
| +--- com.fasterxml.jackson.core:jackson-databind:2.3.3
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.3.0
| | \--- com.fasterxml.jackson.core:jackson-core:2.3.3
| +--- org.hibernate:hibernate-validator:5.0.3.Final
| | +--- javax.validation:validation-api:1.1.0.Final
| | +--- org.jboss.logging:jboss-logging:3.1.1.GA
| | \--- com.fasterxml:classmate:1.0.0
| +--- org.springframework:spring-core:4.0.6.RELEASE (*)
| +--- org.springframework:spring-web:4.0.6.RELEASE
| | +--- org.springframework:spring-aop:4.0.6.RELEASE (*)
| | +--- org.springframework:spring-beans:4.0.6.RELEASE (*)
| | +--- org.springframework:spring-context:4.0.6.RELEASE (*)
| | \--- org.springframework:spring-core:4.0.6.RELEASE (*)
| \--- org.springframework:spring-webmvc:4.0.6.RELEASE
| +--- org.springframework:spring-beans:4.0.6.RELEASE (*)
| +--- org.springframework:spring-context:4.0.6.RELEASE (*)
| +--- org.springframework:spring-core:4.0.6.RELEASE (*)
| +--- org.springframework:spring-expression:4.0.6.RELEASE (*)
| \--- org.springframework:spring-web:4.0.6.RELEASE (*)
\--- org.slf4j:slf4j-api:1.7.1 -> 1.7.7
There are two things I'm not very sure, although I've read some articles:
(*) means this dependency is already present and download in previous steps
1.7.1 -> 1.7.7 this dependency is declared as 1.7.1, but gradle decide to use 1.7.7 after conflict resolution
Not sure if my understanding correct, how can I find some official document to explain them? I searched the gradle website, but not find yet
While not an official documentation, I found the following in gradle dependency-resolution-reporting.md design-doc:
avoid regression of current features:
subtree is omitted (*)
Note, however, that this design-doc was changed on April 2 (see change here) as part of the work on the release of v2.5 and this comment was removed from this document.

Resources