How to check resolve dependencies of build gradle script. For example I have plugin1 and plugin2, how I can figure out what dependencies pull both of them, and each separately?
Is there any parameter to print out this info?
the latest gradle version comes with the buildEnvironment task that does exactly what you need. you can simply run
gradle buildEnvironment
You can use gradle dependencies to get the full list. If your only interesting in a specific module then you can use gradle app:dependencyInsight --dependency com.google.code.gson example for gson
All dependency example outputs are from the project: https://github.com/JBirdVegas/external_jbirdvegas_mGerrit
Here is an example output
$ gradle dependencies app:dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
No configurations
:app:dependencies
------------------------------------------------------------
Project :app
------------------------------------------------------------
_debugAndroidTestApk - ## Internal use, do not manually configure ##
\--- com.android.support:multidex-instrumentation:1.0.1
\--- com.android.support:multidex:1.0.1
_debugAndroidTestCompile - ## Internal use, do not manually configure ##
\--- com.android.support:multidex-instrumentation:1.0.1
\--- com.android.support:multidex:1.0.1
_releaseUnitTestApk - ## Internal use, do not manually configure ##
No dependencies
_releaseUnitTestCompile - ## Internal use, do not manually configure ##
No dependencies
androidJacocoAgent - The Jacoco agent to use to get coverage data.
\--- org.jacoco:org.jacoco.agent:0.7.4.201502262128
androidJacocoAnt - The Jacoco ant tasks to use to get execute Gradle tasks.
\--- org.jacoco:org.jacoco.ant:0.7.4.201502262128
+--- org.jacoco:org.jacoco.core:0.7.4.201502262128
| \--- org.ow2.asm:asm-debug-all:5.0.1
+--- org.jacoco:org.jacoco.report:0.7.4.201502262128
| +--- org.jacoco:org.jacoco.core:0.7.4.201502262128 (*)
| \--- org.ow2.asm:asm-debug-all:5.0.1
\--- org.jacoco:org.jacoco.agent:0.7.4.201502262128
androidTestApk - Classpath packaged with the compiled 'androidTest' classes.
No dependencies
androidTestCompile - Classpath for compiling the androidTest sources.
No dependencies
androidTestProvided - Classpath for only compiling the androidTest sources.
No dependencies
androidTestWearApp - Link to a wear app to embed for object 'androidTest'.
No dependencies
apk - Classpath packaged with the compiled 'main' classes.
No dependencies
archives - Configuration for archive artifacts.
No dependencies
checkstyle - The Checkstyle libraries to be used for this project.
Download https://repo1.maven.org/maven2/com/puppycrawl/tools/checkstyle/5.9/checkstyle-5.9.pom
\--- com.puppycrawl.tools:checkstyle:5.9
+--- antlr:antlr:2.7.7
+--- commons-beanutils:commons-beanutils-core:1.8.3
+--- commons-cli:commons-cli:1.2
\--- com.google.guava:guava-jdk5:14.0.1
compile - Classpath for compiling the main sources.
+--- com.jakewharton.hugo:hugo-annotations:1.2.1
+--- com.android.support:appcompat-v7:23.1.1
| \--- com.android.support:support-v4:23.1.1
| \--- com.android.support:support-annotations:23.1.1
+--- com.android.support:design:23.1.1
| +--- com.android.support:appcompat-v7:23.1.1 (*)
| +--- com.android.support:recyclerview-v7:23.1.1
| | +--- com.android.support:support-annotations:23.1.1
| | \--- com.android.support:support-v4:23.1.1 (*)
| \--- com.android.support:support-v4:23.1.1 (*)
+--- com.google.code.gson:gson:2.4
+--- com.mcxiaoke.volley:library:1.0.18
+--- com.nhaarman.listviewanimations:lib-core:3.1.0
+--- com.nhaarman.listviewanimations:lib-core-slh:3.1.0
+--- com.nineoldandroids:library:2.4.0
+--- de.greenrobot:eventbus:2.4.0
+--- joda-time:joda-time:2.7
+--- org.ajoberstar:gradle-git:1.1.0
| +--- org.ajoberstar:grgit:1.1.0
| | +--- org.eclipse.jgit:org.eclipse.jgit:3.7.0.201502260915-r
| | | +--- com.jcraft:jsch:0.1.50
| | | +--- com.googlecode.javaewah:JavaEWAH:0.7.9
| | | +--- org.apache.httpcomponents:httpclient:4.1.3
| | | | +--- org.apache.httpcomponents:httpcore:4.1.4
| | | | +--- commons-logging:commons-logging:1.1.1
| | | | \--- commons-codec:commons-codec:1.4
| | | \--- org.slf4j:slf4j-api:1.7.2 -> 1.7.7
| | +--- org.eclipse.jgit:org.eclipse.jgit.ui:3.7.0.201502260915-r
| | | \--- org.eclipse.jgit:org.eclipse.jgit:3.7.0.201502260915-r (*)
| | +--- com.jcraft:jsch.agentproxy.jsch:0.0.7
| | | +--- com.jcraft:jsch:0.1.49 -> 0.1.50
| | | \--- com.jcraft:jsch.agentproxy.core:0.0.7
| | +--- com.jcraft:jsch.agentproxy.pageant:0.0.7
| | | +--- com.jcraft:jsch.agentproxy.core:0.0.7
| | | +--- net.java.dev.jna:jna:3.4.0
| | | \--- net.java.dev.jna:platform:3.4.0
| | +--- com.jcraft:jsch.agentproxy.sshagent:0.0.7
| | | \--- com.jcraft:jsch.agentproxy.core:0.0.7
| | +--- com.jcraft:jsch.agentproxy.usocket-jna:0.0.7
| | | +--- com.jcraft:jsch.agentproxy.core:0.0.7
| | | +--- net.java.dev.jna:jna:3.4.0
| | | \--- net.java.dev.jna:platform:3.4.0
| | +--- com.jcraft:jsch.agentproxy.usocket-nc:0.0.7
| | | \--- com.jcraft:jsch.agentproxy.core:0.0.7
| | \--- org.slf4j:slf4j-api:1.7.7
| \--- com.github.zafarkhaja:java-semver:0.8.0
+--- se.emilsjolander:stickylistheaders:2.6.0
+--- com.github.dmytrodanylyk.android-process-button:library:1.0.3
+--- de.hdodenhof:circleimageview:1.2.2
+--- com.google.guava:guava:18.0
+--- org.apache.httpcomponents:httpclient-android:4.3.5.1
+--- com.android.support:multidex:1.0.1
+--- com.anupcowkur:reservoir:2.1
| +--- com.jakewharton:disklrucache:2.0.2
| +--- com.google.code.gson:gson:2.2.4 -> 2.4
| +--- commons-io:commons-io:2.4
| \--- io.reactivex:rxandroid:0.24.0
| \--- io.reactivex:rxjava:1.0.4
\--- com.mikepenz:materialdrawer:4.5.5
+--- com.android.support:recyclerview-v7:23.1.1 (*)
+--- com.mikepenz:materialize:0.5.1
+--- com.mikepenz:iconics-core:2.5.0
\--- com.android.support:support-annotations:23.1.1
debugApk - Classpath packaged with the compiled 'debug' classes.
No dependencies
debugCompile - Classpath for compiling the debug sources.
+--- com.jakewharton.hugo:hugo-runtime:1.2.1
| +--- com.jakewharton.hugo:hugo-annotations:1.2.1
| \--- org.aspectj:aspectjrt:1.8.5
\--- org.aspectj:aspectjrt:1.8.5
For an example of app:dependencyInsight for gson
$ gradle app:dependencyInsight --configuration compile --dependency com.google.code.gson
:app:dependencyInsight
com.google.code.gson:gson:2.4 (conflict resolution)
\--- compile
com.google.code.gson:gson:2.2.4 -> 2.4
\--- com.anupcowkur:reservoir:2.1
\--- compile
BUILD SUCCESSFUL
Total time: 1.018 secs
EDIT:
To get the build script dependencies I think you need a custom task... Something like this
task buildScriptDependencies(type: org.gradle.api.tasks.diagnostics.DependencyReportTask) {
configurations = project.buildscript.configurations
}
Then you can quickly get the build script dependencies from the command line:
$ gradle buildScriptDependencies
Configuration on demand is an incubating feature.
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
versionCode: 2111073 versionName: 2.111.73
Applying signing plugin
Not signing release. keyStoreFile was not defined in private.creds
Adding git task
WARNING: Dependency org.apache.httpcomponents:httpclient:4.1.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency org.apache.httpcomponents:httpclient:4.1.3 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Adding javadoc task
Adding style task
:buildScriptDependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
classpath
+--- com.android.tools.build:gradle:1.5.0
| \--- com.android.tools.build:gradle-core:1.5.0
| +--- com.android.tools.build:builder:1.5.0
| | +--- com.android.tools.build:builder-model:1.5.0
| | | \--- com.android.tools:annotations:24.5.0
| | +--- com.android.tools.build:builder-test-api:1.5.0
| | | \--- com.android.tools.ddms:ddmlib:24.5.0
| | | +--- com.android.tools:common:24.5.0
| | | | +--- com.android.tools:annotations:24.5.0
| | | | \--- com.google.guava:guava:17.0
| | | \--- net.sf.kxml:kxml2:2.3.0
| | +--- com.android.tools.build:transform-api:1.5.0
| | | +--- com.android.tools:annotations:24.5.0
| | | \--- com.google.guava:guava:17.0
| | +--- com.android.tools:sdklib:24.5.0
| | | +--- com.android.tools.layoutlib:layoutlib-api:24.5.0
| | | | +--- com.android.tools:common:24.5.0 (*)
| | | | +--- net.sf.kxml:kxml2:2.3.0
| | | | +--- com.android.tools:annotations:24.5.0
| | | | \--- com.intellij:annotations:12.0
| | | +--- com.android.tools:dvlib:24.5.0
| | | | \--- com.android.tools:common:24.5.0 (*)
| | | +--- com.google.code.gson:gson:2.2.4
| | | +--- org.apache.commons:commons-compress:1.8.1
| | | +--- org.apache.httpcomponents:httpclient:4.1.1
| | | | +--- org.apache.httpcomponents:httpcore:4.1
| | | | +--- commons-logging:commons-logging:1.1.1
| | | | \--- commons-codec:commons-codec:1.4
| | | \--- org.apache.httpcomponents:httpmime:4.1
| | | +--- org.apache.httpcomponents:httpcore:4.1
| | | \--- commons-logging:commons-logging:1.1.1
| | +--- com.android.tools:sdk-common:24.5.0
| | | +--- com.android.tools:sdklib:24.5.0 (*)
| | | +--- com.android.tools.build:builder-test-api:1.5.0 (*)
| | | \--- com.android.tools.build:builder-model:1.5.0 (*)
| | +--- com.android.tools:common:24.5.0 (*)
| | +--- com.android.tools.build:manifest-merger:24.5.0
| | | +--- com.android.tools:common:24.5.0 (*)
| | | +--- com.android.tools:sdklib:24.5.0 (*)
| | | +--- com.android.tools:sdk-common:24.5.0 (*)
| | | +--- net.sf.kxml:kxml2:2.3.0
| | | \--- com.google.code.gson:gson:2.2.4
| | +--- com.android.tools.ddms:ddmlib:24.5.0 (*)
| | +--- com.android.tools.jack:jack-api:0.9.0
| | +--- com.android.tools.jill:jill-api:0.9.0
| | +--- com.squareup:javawriter:2.5.0
| | +--- org.bouncycastle:bcpkix-jdk15on:1.48
| | | \--- org.bouncycastle:bcprov-jdk15on:1.48
| | +--- org.bouncycastle:bcprov-jdk15on:1.48
| | +--- org.ow2.asm:asm:5.0.3
| | +--- org.ow2.asm:asm-tree:5.0.3
| | | \--- org.ow2.asm:asm:5.0.3
| | +--- org.antlr:antlr-runtime:3.5.2
| | \--- org.antlr:antlr:3.5.2
| | +--- org.antlr:antlr-runtime:3.5.2
| | \--- org.antlr:ST4:4.0.8
| | \--- org.antlr:antlr-runtime:3.5.2
| +--- com.android.tools.lint:lint:24.5.0
| | +--- com.android.tools.lint:lint-checks:24.5.0
| | | +--- com.android.tools.lint:lint-api:24.5.0
| | | | +--- com.android.tools:sdk-common:24.5.0 (*)
| | | | +--- com.android.tools.build:builder-model:1.5.0 (*)
| | | | +--- com.android.tools.external.lombok:lombok-ast:0.2.3
| | | | | \--- com.google.guava:guava:17.0
| | | | +--- org.ow2.asm:asm:5.0.3
| | | | \--- org.ow2.asm:asm-tree:5.0.3 (*)
| | | \--- org.ow2.asm:asm-analysis:5.0.3
| | | \--- org.ow2.asm:asm-tree:5.0.3 (*)
| | \--- org.eclipse.jdt.core.compiler:ecj:4.4.2
| +--- com.android.tools.build:transform-api:1.5.0 (*)
| +--- com.android.databinding:compilerCommon:1.0-rc5
| | +--- com.android.databinding:baseLibrary:1.0-rc5
| | +--- org.apache.commons:commons-lang3:3.3.2
| | +--- com.tunnelvisionlabs:antlr4:4.5
| | | +--- com.tunnelvisionlabs:antlr4-runtime:4.5
| | | | +--- org.abego.treelayout:org.abego.treelayout.core:1.0.1
| | | | \--- com.tunnelvisionlabs:antlr4-annotations:4.5
| | | +--- com.tunnelvisionlabs:antlr4-annotations:4.5
| | | +--- org.antlr:antlr-runtime:3.5.2
| | | \--- org.antlr:ST4:4.0.8 (*)
| | +--- commons-io:commons-io:2.4
| | \--- com.googlecode.juniversalchardet:juniversalchardet:1.0.3
| +--- net.sf.proguard:proguard-gradle:5.2.1
| | \--- net.sf.proguard:proguard-base:5.2.1
| \--- org.jacoco:org.jacoco.core:0.7.4.201502262128
| \--- org.ow2.asm:asm-debug-all:5.0.1
\--- com.gradle:build-receipt-plugin:1.0
(*) - dependencies omitted (listed previously)
BUILD SUCCESSFUL
Total time: 0.961 secs
Related
I create a SpringBoot project, and I can not use class which in spring-beans jar package, But spring-beans package is shown in dependency tree
In addition to import spring-beans jar directly, how can I use class in spring-beans
Here is dependency tree. I can found many jar depend on spring-beans, but I can not import any class in spring-beans jar. And I also found many other dependent jars, and I can import class in these jars
compileClasspath - Compile classpath for source set 'main'.
+--- org.projectlombok:lombok:1.18.22
+--- org.springframework.boot:spring-boot-starter-jetty:2.1.18.RELEASE
| +--- org.eclipse.jetty:jetty-servlets:9.4.33.v20201020 -> 9.4.45.v20220203
| | +--- org.eclipse.jetty:jetty-continuation:9.4.45.v20220203
| | +--- org.eclipse.jetty:jetty-http:9.4.45.v20220203
| | | +--- org.eclipse.jetty:jetty-util:9.4.45.v20220203
| | | \--- org.eclipse.jetty:jetty-io:9.4.45.v20220203
| | | \--- org.eclipse.jetty:jetty-util:9.4.45.v20220203
| | +--- org.eclipse.jetty:jetty-util:9.4.45.v20220203
| | \--- org.eclipse.jetty:jetty-io:9.4.45.v20220203 (*)
| +--- org.eclipse.jetty:jetty-webapp:9.4.33.v20201020 -> 9.4.45.v20220203
| | +--- org.eclipse.jetty:jetty-xml:9.4.45.v20220203
| | | \--- org.eclipse.jetty:jetty-util:9.4.45.v20220203
| | \--- org.eclipse.jetty:jetty-servlet:9.4.45.v20220203
| | +--- org.eclipse.jetty:jetty-security:9.4.45.v20220203
| | | \--- org.eclipse.jetty:jetty-server:9.4.45.v20220203
| | | +--- javax.servlet:javax.servlet-api:3.1.0 -> 4.0.1
| | | +--- org.eclipse.jetty:jetty-http:9.4.45.v20220203 (*)
| | | \--- org.eclipse.jetty:jetty-io:9.4.45.v20220203 (*)
| | \--- org.eclipse.jetty:jetty-util-ajax:9.4.45.v20220203
| | \--- org.eclipse.jetty:jetty-util:9.4.45.v20220203
| +--- org.eclipse.jetty.websocket:websocket-server:9.4.33.v20201020 -> 9.4.45.v20220203
| | +--- org.eclipse.jetty.websocket:websocket-common:9.4.45.v20220203
| | | +--- org.eclipse.jetty.websocket:websocket-api:9.4.45.v20220203
| | | +--- org.eclipse.jetty:jetty-util:9.4.45.v20220203
| | | \--- org.eclipse.jetty:jetty-io:9.4.45.v20220203 (*)
| | +--- org.eclipse.jetty.websocket:websocket-client:9.4.45.v20220203
| | | +--- org.eclipse.jetty:jetty-client:9.4.45.v20220203
| | | | +--- org.eclipse.jetty:jetty-http:9.4.45.v20220203 (*)
| | | | \--- org.eclipse.jetty:jetty-io:9.4.45.v20220203 (*)
| | | +--- org.eclipse.jetty:jetty-util:9.4.45.v20220203
| | | +--- org.eclipse.jetty:jetty-io:9.4.45.v20220203 (*)
| | | \--- org.eclipse.jetty.websocket:websocket-common:9.4.45.v20220203 (*)
| | +--- org.eclipse.jetty.websocket:websocket-servlet:9.4.45.v20220203
| | | +--- org.eclipse.jetty.websocket:websocket-api:9.4.45.v20220203
| | | \--- javax.servlet:javax.servlet-api:3.1.0 -> 4.0.1
| | +--- org.eclipse.jetty:jetty-servlet:9.4.45.v20220203 (*)
| | \--- org.eclipse.jetty:jetty-http:9.4.45.v20220203 (*)
| +--- org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.33.v20201020 -> 9.4.45.v20220203
| | +--- org.eclipse.jetty:jetty-annotations:9.4.45.v20220203
| | | +--- org.eclipse.jetty:jetty-plus:9.4.45.v20220203
| | | | \--- org.eclipse.jetty:jetty-webapp:9.4.45.v20220203 (*)
| | | +--- org.eclipse.jetty:jetty-webapp:9.4.45.v20220203 (*)
| | | +--- javax.annotation:javax.annotation-api:1.3.2
| | | +--- 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.45.v20220203
| | | \--- org.eclipse.jetty.websocket:websocket-client:9.4.45.v20220203 (*)
| | +--- org.eclipse.jetty.websocket:websocket-server:9.4.45.v20220203 (*)
| | \--- javax.websocket:javax.websocket-api:1.0 -> 1.1
| \--- org.mortbay.jasper:apache-el:8.5.54 -> 9.0.52
+--- org.springframework.boot:spring-boot-starter -> 2.6.5
| +--- org.springframework.boot:spring-boot:2.6.5
| | +--- org.springframework:spring-core:5.3.17
| | | \--- org.springframework:spring-jcl:5.3.17
| | \--- org.springframework:spring-context:5.3.17
| | +--- org.springframework:spring-aop:5.3.17
| | | +--- org.springframework:spring-beans:5.3.17
| | | | \--- org.springframework:spring-core:5.3.17 (*)
| | | \--- org.springframework:spring-core:5.3.17 (*)
| | +--- org.springframework:spring-beans:5.3.17 (*)
| | +--- org.springframework:spring-core:5.3.17 (*)
| | \--- org.springframework:spring-expression:5.3.17
| | \--- org.springframework:spring-core:5.3.17 (*)
| +--- org.springframework.boot:spring-boot-autoconfigure:2.6.5
| | \--- org.springframework.boot:spring-boot:2.6.5 (*)
| +--- org.springframework.boot:spring-boot-starter-logging:2.6.5
| | +--- 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.17 (*)
| \--- org.yaml:snakeyaml:1.29
+--- org.springframework.boot:spring-boot-starter-web:2.6.5
| +--- org.springframework.boot:spring-boot-starter:2.6.5 (*)
| +--- org.springframework.boot:spring-boot-starter-json:2.6.5
| | +--- org.springframework.boot:spring-boot-starter:2.6.5 (*)
| | +--- org.springframework:spring-web:5.3.17
| | | +--- org.springframework:spring-beans:5.3.17 (*)
| | | \--- org.springframework:spring-core:5.3.17 (*)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.13.2
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.13.2
| | | | \--- com.fasterxml.jackson:jackson-bom:2.13.2
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.13.2 (c)
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.13.2 (c)
| | | | +--- com.fasterxml.jackson.core:jackson-databind:2.13.2 (c)
| | | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.2 (c)
| | | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.2 (c)
| | | | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.2 (c)
| | | +--- com.fasterxml.jackson.core:jackson-core:2.13.2
| | | | \--- com.fasterxml.jackson:jackson-bom:2.13.2 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.13.2 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.2
| | | +--- com.fasterxml.jackson.core:jackson-core:2.13.2 (*)
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.13.2 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.13.2 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.2
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.13.2 (*)
| | | +--- com.fasterxml.jackson.core:jackson-core:2.13.2 (*)
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.13.2 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.13.2 (*)
| | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.2
| | +--- com.fasterxml.jackson.core:jackson-core:2.13.2 (*)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.13.2 (*)
| | \--- com.fasterxml.jackson:jackson-bom:2.13.2 (*)
| +--- org.springframework.boot:spring-boot-starter-tomcat:2.6.5
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.60
| | +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.60
| | \--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.60
| | \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.60
| +--- org.springframework:spring-web:5.3.17 (*)
| \--- org.springframework:spring-webmvc:5.3.17
| +--- org.springframework:spring-aop:5.3.17 (*)
| +--- org.springframework:spring-beans:5.3.17 (*)
| +--- org.springframework:spring-context:5.3.17 (*)
| +--- org.springframework:spring-core:5.3.17 (*)
| +--- org.springframework:spring-expression:5.3.17 (*)
| \--- org.springframework:spring-web:5.3.17 (*)
+--- org.springframework.boot:spring-boot-starter-aop -> 2.6.5
| +--- org.springframework.boot:spring-boot-starter:2.6.5 (*)
| +--- org.springframework:spring-aop:5.3.17 (*)
| \--- org.aspectj:aspectjweaver:1.9.7
+--- org.codehaus.groovy:groovy:2.5.0
+--- org.antlr:antlr4:4.10.1
| +--- org.antlr:antlr4-runtime:4.10.1
| +--- org.antlr:antlr-runtime:3.5.3
| +--- org.antlr:ST4:4.3.3
| | \--- org.antlr:antlr-runtime:3.5.2 -> 3.5.3
| +--- org.abego.treelayout:org.abego.treelayout.core:1.0.3
| +--- org.glassfish:javax.json:1.0.4
| \--- com.ibm.icu:icu4j:69.1
+--- commons-io:commons-io:2.8.0
+--- org.springframework.boot:spring-boot-starter-quartz -> 2.6.5
| +--- org.springframework.boot:spring-boot-starter:2.6.5 (*)
| +--- org.springframework:spring-context-support:5.3.17
| | +--- org.springframework:spring-beans:5.3.17 (*)
| | +--- org.springframework:spring-context:5.3.17 (*)
| | \--- org.springframework:spring-core:5.3.17 (*)
| +--- org.springframework:spring-tx:5.3.17
| | +--- org.springframework:spring-beans:5.3.17 (*)
| | \--- org.springframework:spring-core:5.3.17 (*)
| \--- org.quartz-scheduler:quartz:2.3.2
| +--- com.mchange:mchange-commons-java:0.2.15
| \--- org.slf4j:slf4j-api:1.7.7 -> 1.7.36
+--- org.springframework.boot:spring-boot-starter-security -> 2.6.5
| +--- org.springframework.boot:spring-boot-starter:2.6.5 (*)
| +--- org.springframework:spring-aop:5.3.17 (*)
| +--- org.springframework.security:spring-security-config:5.6.2
| | +--- org.springframework.security:spring-security-core:5.6.2
| | | +--- org.springframework.security:spring-security-crypto:5.6.2
| | | +--- org.springframework:spring-aop:5.3.16 -> 5.3.17 (*)
| | | +--- org.springframework:spring-beans:5.3.16 -> 5.3.17 (*)
| | | +--- org.springframework:spring-context:5.3.16 -> 5.3.17 (*)
| | | +--- org.springframework:spring-core:5.3.16 -> 5.3.17 (*)
| | | \--- org.springframework:spring-expression:5.3.16 -> 5.3.17 (*)
| | +--- org.springframework:spring-aop:5.3.16 -> 5.3.17 (*)
| | +--- org.springframework:spring-beans:5.3.16 -> 5.3.17 (*)
| | +--- org.springframework:spring-context:5.3.16 -> 5.3.17 (*)
| | \--- org.springframework:spring-core:5.3.16 -> 5.3.17 (*)
| \--- org.springframework.security:spring-security-web:5.6.2
| +--- org.springframework.security:spring-security-core:5.6.2 (*)
| +--- org.springframework:spring-core:5.3.16 -> 5.3.17 (*)
| +--- org.springframework:spring-aop:5.3.16 -> 5.3.17 (*)
| +--- org.springframework:spring-beans:5.3.16 -> 5.3.17 (*)
| +--- org.springframework:spring-context:5.3.16 -> 5.3.17 (*)
| +--- org.springframework:spring-expression:5.3.16 -> 5.3.17 (*)
| \--- org.springframework:spring-web:5.3.16 -> 5.3.17 (*)
+--- org.springframework.boot:spring-boot-starter-validation -> 2.6.5
| +--- org.springframework.boot:spring-boot-starter:2.6.5 (*)
| +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.60
| \--- org.hibernate.validator:hibernate-validator:6.2.3.Final
| +--- jakarta.validation:jakarta.validation-api:2.0.2
| +--- org.jboss.logging:jboss-logging:3.4.1.Final -> 3.4.3.Final
| \--- com.fasterxml:classmate:1.5.1
+--- org.springframework.boot:spring-boot-starter-jdbc -> 2.6.5
| +--- org.springframework.boot:spring-boot-starter:2.6.5 (*)
| +--- com.zaxxer:HikariCP:4.0.3
| | \--- org.slf4j:slf4j-api:1.7.30 -> 1.7.36
| \--- org.springframework:spring-jdbc:5.3.17
| +--- org.springframework:spring-beans:5.3.17 (*)
| +--- org.springframework:spring-core:5.3.17 (*)
| \--- org.springframework:spring-tx:5.3.17 (*)
+--- org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.0
| +--- org.springframework.boot:spring-boot-starter:2.1.6.RELEASE -> 2.6.5 (*)
| +--- org.springframework.boot:spring-boot-starter-jdbc:2.1.6.RELEASE -> 2.6.5 (*)
| +--- org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.0
| | \--- org.springframework.boot:spring-boot-autoconfigure:2.1.6.RELEASE -> 2.6.5 (*)
| +--- org.mybatis:mybatis:3.5.2
| \--- org.mybatis:mybatis-spring:2.0.2
+--- mysql:mysql-connector-java:8.0.21
+--- org.xerial.snappy:snappy-java:1.1.7.3
+--- org.apache.commons:commons-lang3:3.12.0
+--- io.netty:netty-all:4.1.42.Final
+--- 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
\--- com.alibaba:druid:1.2.8
(c) - dependency constraint
(*) - dependencies omitted (listed previously)
A web-based, searchable dependency report is available by adding the --scan option.
BUILD SUCCESSFUL in 4s
I have import dependency implementation group: "org.springframework.boot", name: "spring-boot-starter-jetty", version: "2.1.18.RELEASE" in project A. And here is dependency tree:
+--- org.springframework.boot:spring-boot-starter-jetty -> 2.1.18.RELEASE
| +--- org.eclipse.jetty:jetty-servlets:9.4.33.v20201020
| | +--- org.eclipse.jetty:jetty-continuation:9.4.33.v20201020
| | +--- org.eclipse.jetty:jetty-http:9.4.33.v20201020
| | | +--- org.eclipse.jetty:jetty-util:9.4.33.v20201020
| | | \--- org.eclipse.jetty:jetty-io:9.4.33.v20201020
| | | \--- org.eclipse.jetty:jetty-util:9.4.33.v20201020
| | +--- org.eclipse.jetty:jetty-util:9.4.33.v20201020
| | \--- org.eclipse.jetty:jetty-io:9.4.33.v20201020 (*)
| +--- org.eclipse.jetty:jetty-webapp:9.4.33.v20201020
| | +--- org.eclipse.jetty:jetty-xml:9.4.33.v20201020
| | | \--- org.eclipse.jetty:jetty-util:9.4.33.v20201020
| | \--- org.eclipse.jetty:jetty-servlet:9.4.33.v20201020
| | \--- org.eclipse.jetty:jetty-security:9.4.33.v20201020
| | \--- org.eclipse.jetty:jetty-server:9.4.33.v20201020 -> 9.4.48.v20220622
| | +--- javax.servlet:javax.servlet-api:3.1.0 -> 4.0.1
| | +--- org.eclipse.jetty:jetty-http:9.4.48.v20220622 -> 9.4.33.v20201020 (*)
| | \--- org.eclipse.jetty:jetty-io:9.4.48.v20220622 -> 9.4.33.v20201020 (*)
| +--- org.eclipse.jetty.websocket:websocket-server:9.4.33.v20201020
| | +--- org.eclipse.jetty.websocket:websocket-common:9.4.33.v20201020
| | | +--- org.eclipse.jetty.websocket:websocket-api:9.4.33.v20201020
| | | +--- org.eclipse.jetty:jetty-util:9.4.33.v20201020
| | | \--- org.eclipse.jetty:jetty-io:9.4.33.v20201020 (*)
| | +--- org.eclipse.jetty.websocket:websocket-client:9.4.33.v20201020
| | | +--- org.eclipse.jetty:jetty-client:9.4.33.v20201020
| | | | +--- org.eclipse.jetty:jetty-http:9.4.33.v20201020 (*)
| | | | \--- org.eclipse.jetty:jetty-io:9.4.33.v20201020 (*)
| | | +--- org.eclipse.jetty:jetty-xml:9.4.33.v20201020 (*)
| | | +--- org.eclipse.jetty:jetty-util:9.4.33.v20201020
| | | +--- org.eclipse.jetty:jetty-io:9.4.33.v20201020 (*)
| | | \--- org.eclipse.jetty.websocket:websocket-common:9.4.33.v20201020 (*)
| | +--- org.eclipse.jetty.websocket:websocket-servlet:9.4.33.v20201020
| | | +--- org.eclipse.jetty.websocket:websocket-api:9.4.33.v20201020
| | | \--- javax.servlet:javax.servlet-api:3.1.0 -> 4.0.1
| | +--- org.eclipse.jetty:jetty-servlet:9.4.33.v20201020 (*)
| | \--- org.eclipse.jetty:jetty-http:9.4.33.v20201020 (*)
| +--- org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.33.v20201020
| | +--- org.eclipse.jetty:jetty-annotations:9.4.33.v20201020
| | | +--- org.eclipse.jetty:jetty-plus:9.4.33.v20201020
| | | | \--- org.eclipse.jetty:jetty-webapp:9.4.33.v20201020 (*)
| | | +--- org.eclipse.jetty:jetty-webapp:9.4.33.v20201020 (*)
| | | +--- javax.annotation:javax.annotation-api:1.3.2
| | | +--- org.ow2.asm:asm:9.0
| | | \--- org.ow2.asm:asm-commons:9.0
| | | +--- org.ow2.asm:asm:9.0
| | | +--- org.ow2.asm:asm-tree:9.0
| | | | \--- org.ow2.asm:asm:9.0
| | | \--- org.ow2.asm:asm-analysis:9.0
| | | \--- org.ow2.asm:asm-tree:9.0 (*)
| | +--- org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.33.v20201020
| | | \--- org.eclipse.jetty.websocket:websocket-client:9.4.33.v20201020 (*)
| | +--- org.eclipse.jetty.websocket:websocket-server:9.4.33.v20201020 (*)
| | \--- javax.websocket:javax.websocket-api:1.0 -> 1.1
| \--- org.mortbay.jasper:apache-el:8.5.54
I can not understand why module jetty-server upgrade from 9.4.33.v20201020 to 9.4.48.v20220622,because other jetty module version remain at 9.4.33.v20201020
And I import dependency implementation group: "org.springframework.boot", name: "spring-boot-starter-jetty", version: "2.1.18.RELEASE" in another clean project B. And here is dependency tree:
All jetty module version is unified:9.4.45
Why does the same dependency implementation group: "org.springframework.boot", name: "spring-boot-starter-jetty", version: "2.1.18.RELEASE refer different version of module jetty
As you may know Gradle implementation acts transitively which means any dependencies bring its dependencies. Although your jetty-server version is 9.4.33.v20201020 but somehow spring-boot-starter-jetty is dependent on jetty-servlets:9.4.48.v20220622 so it's being brought. However, it's a little waired that your second screenshot shows version 9.4.45 because I myself test it with an isolated project and the version was 9.4.48. Anyway, you can inform the implementation to not act completely transitively and exclude some dependencies like blow:
implementation("org.springframework.boot:spring-boot-starter-jetty:2.1.18.RELEASE")
{
exclude group: "org.eclipse.jetty"
}
But if there is org.eclipse.jetty that spring-boot-starter-jetty is dependent on, you had to put it inside your build.gradle or exclude the malicious module specifically like blow:
implementation("org.springframework.boot:spring-boot-starter-jetty:2.1.18.RELEASE")
{
exclude group: "org.eclipse.jetty", module: "jetty-servlets"
}
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
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
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.