Spring #ControllerAdvice - NoClassDefFoundError: javax/servlet/ServletException - spring

I have my ExceptionHandler in spring project. I want to use #ControllerAdvice in my project, but i have some trouble with it. When i build project, i have errors,but if i comment #ControllerAdvice, my project build fine.For build I use gradle. Below i add code of errors, MyExceptionHandler and build.gradle.
java.lang.NoClassDefFoundError: javax/servlet/ServletException
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[na:na]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[na:na]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[na:na]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:na]
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3215) ~[na:na]
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2435) ~[na:na]
at org.springframework.boot.context.properties.ConfigurationPropertiesBindConstructorProvider.findConstructorBindingAnnotatedConstructor(ConfigurationPropertiesBindConstructorProvider.java:62) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.context.properties.ConfigurationPropertiesBindConstructorProvider.getBindConstructor(ConfigurationPropertiesBindConstructorProvider.java:48) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.context.properties.ConfigurationPropertiesBean$BindMethod.forType(ConfigurationPropertiesBean.java:311) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.context.properties.ConfigurationPropertiesBeanDefinitionValidator.validate(ConfigurationPropertiesBeanDefinitionValidator.java:63) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.context.properties.ConfigurationPropertiesBeanDefinitionValidator.postProcessBeanFactory(ConfigurationPropertiesBeanDefinitionValidator.java:45) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:174) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at com.andreirozov.cyclingserver.CyclingserverApplication.main(CyclingserverApplication.java:10) ~[main/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.2.6.RELEASE.jar:2.2.6.RELEASE]
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
... 50 common frames omitted
My exception handler:
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
#ControllerAdvice
public class MyExceptionHandler extends ResponseEntityExceptionHandler {
#ExceptionHandler(EmptyListException.class)
protected ResponseEntity<MyException> handleEmptyListException() {
return new ResponseEntity<>(new MyException("Unexpected empty list"), HttpStatus.NOT_FOUND);
}
#ExceptionHandler(ParseException.class)
protected ResponseEntity<MyException> handleParseException() {
return new ResponseEntity<>(new MyException("Jsoup parse error"), HttpStatus.NOT_FOUND);
}
protected static class MyException {
private String message;
public MyException(String m) {
message = m;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
}
My build.gradle:
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'war'
}
group = 'com.andreirozov'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '14'
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
compile 'org.jsoup:jsoup:1.13.1'
compile 'org.springframework.boot:spring-boot-starter-hateoas'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
Dependecies tree:
compileClasspath - Compile classpath for source set 'main'.
+--- org.jsoup:jsoup:1.13.1
+--- org.springframework.boot:spring-boot-starter-hateoas -> 2.2.6.RELEASE
| +--- org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE
| | +--- org.springframework.boot:spring-boot-starter:2.2.6.RELEASE
| | | +--- org.springframework.boot:spring-boot:2.2.6.RELEASE
| | | | +--- org.springframework:spring-core:5.2.5.RELEASE
| | | | | \--- org.springframework:spring-jcl:5.2.5.RELEASE
| | | | \--- org.springframework:spring-context:5.2.5.RELEASE
| | | | +--- org.springframework:spring-aop:5.2.5.RELEASE
| | | | | +--- org.springframework:spring-beans:5.2.5.RELEASE
| | | | | | \--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | | | \--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | | +--- org.springframework:spring-beans:5.2.5.RELEASE (*)
| | | | +--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | | \--- org.springframework:spring-expression:5.2.5.RELEASE
| | | | \--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | +--- org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE
| | | | \--- org.springframework.boot:spring-boot:2.2.6.RELEASE (*)
| | | +--- org.springframework.boot:spring-boot-starter-logging:2.2.6.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.12.1
| | | | | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | | | \--- org.apache.logging.log4j:log4j-api:2.12.1
| | | | \--- 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.5.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-starter-json:2.2.6.RELEASE
| | | +--- org.springframework.boot:spring-boot-starter:2.2.6.RELEASE (*)
| | | +--- org.springframework:spring-web:5.2.5.RELEASE
| | | | +--- org.springframework:spring-beans:5.2.5.RELEASE (*)
| | | | \--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.10.3
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.10.3
| | | | \--- com.fasterxml.jackson.core:jackson-core:2.10.3
| | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.3
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.10.3
| | | | \--- com.fasterxml.jackson.core:jackson-databind:2.10.3 (*)
| | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.3
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.10.3
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.10.3
| | | | \--- com.fasterxml.jackson.core:jackson-databind:2.10.3 (*)
| | | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.3
| | | +--- com.fasterxml.jackson.core:jackson-core:2.10.3
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.10.3 (*)
| | +--- org.springframework.boot:spring-boot-starter-tomcat:2.2.6.RELEASE
| | | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | | +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.33
| | | +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.33
| | | \--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.33
| | | \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.33
| | +--- org.springframework.boot:spring-boot-starter-validation:2.2.6.RELEASE
| | | +--- org.springframework.boot:spring-boot-starter:2.2.6.RELEASE (*)
| | | +--- jakarta.validation:jakarta.validation-api:2.0.2
| | | \--- org.hibernate.validator:hibernate-validator:6.0.18.Final
| | | +--- org.jboss.logging:jboss-logging:3.3.2.Final -> 3.4.1.Final
| | | \--- com.fasterxml:classmate:1.3.4 -> 1.5.1
| | +--- org.springframework:spring-web:5.2.5.RELEASE (*)
| | \--- org.springframework:spring-webmvc:5.2.5.RELEASE
| | +--- org.springframework:spring-aop:5.2.5.RELEASE (*)
| | +--- org.springframework:spring-beans:5.2.5.RELEASE (*)
| | +--- org.springframework:spring-context:5.2.5.RELEASE (*)
| | +--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | +--- org.springframework:spring-expression:5.2.5.RELEASE (*)
| | \--- org.springframework:spring-web:5.2.5.RELEASE (*)
| \--- org.springframework.hateoas:spring-hateoas:1.0.4.RELEASE
| +--- org.springframework:spring-aop:5.2.5.RELEASE (*)
| +--- org.springframework:spring-beans:5.2.5.RELEASE (*)
| +--- org.springframework:spring-context:5.2.5.RELEASE (*)
| +--- org.springframework:spring-core:5.2.5.RELEASE (*)
| +--- org.springframework:spring-web:5.2.5.RELEASE (*)
| +--- org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE
| | +--- org.springframework:spring-beans:5.2.0.RELEASE -> 5.2.5.RELEASE (*)
| | +--- org.springframework:spring-context:5.2.0.RELEASE -> 5.2.5.RELEASE (*)
| | +--- org.springframework:spring-aop:5.2.0.RELEASE -> 5.2.5.RELEASE (*)
| | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| +--- 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
| \--- org.slf4j:slf4j-api:1.7.30
+--- org.springframework.boot:spring-boot-starter-web -> 2.2.6.RELEASE (*)
\--- javax.servlet:javax.servlet-api:3.1.0
runtimeClasspath - Runtime classpath of source set 'main'.
+--- org.jsoup:jsoup:1.13.1
+--- org.springframework.boot:spring-boot-starter-hateoas -> 2.2.6.RELEASE
| +--- org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE
| | +--- org.springframework.boot:spring-boot-starter:2.2.6.RELEASE
| | | +--- org.springframework.boot:spring-boot:2.2.6.RELEASE
| | | | +--- org.springframework:spring-core:5.2.5.RELEASE
| | | | | \--- org.springframework:spring-jcl:5.2.5.RELEASE
| | | | \--- org.springframework:spring-context:5.2.5.RELEASE
| | | | +--- org.springframework:spring-aop:5.2.5.RELEASE
| | | | | +--- org.springframework:spring-beans:5.2.5.RELEASE
| | | | | | \--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | | | \--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | | +--- org.springframework:spring-beans:5.2.5.RELEASE (*)
| | | | +--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | | \--- org.springframework:spring-expression:5.2.5.RELEASE
| | | | \--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | +--- org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE
| | | | \--- org.springframework.boot:spring-boot:2.2.6.RELEASE (*)
| | | +--- org.springframework.boot:spring-boot-starter-logging:2.2.6.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.12.1
| | | | | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| | | | | \--- org.apache.logging.log4j:log4j-api:2.12.1
| | | | \--- 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.5.RELEASE (*)
| | | \--- org.yaml:snakeyaml:1.25
| | +--- org.springframework.boot:spring-boot-starter-json:2.2.6.RELEASE
| | | +--- org.springframework.boot:spring-boot-starter:2.2.6.RELEASE (*)
| | | +--- org.springframework:spring-web:5.2.5.RELEASE
| | | | +--- org.springframework:spring-beans:5.2.5.RELEASE (*)
| | | | \--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.10.3
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.10.3
| | | | \--- com.fasterxml.jackson.core:jackson-core:2.10.3
| | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.3
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.10.3
| | | | \--- com.fasterxml.jackson.core:jackson-databind:2.10.3 (*)
| | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.3
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.10.3
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.10.3
| | | | \--- com.fasterxml.jackson.core:jackson-databind:2.10.3 (*)
| | | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.3
| | | +--- com.fasterxml.jackson.core:jackson-core:2.10.3
| | | \--- com.fasterxml.jackson.core:jackson-databind:2.10.3 (*)
| | +--- org.springframework.boot:spring-boot-starter-tomcat:2.2.6.RELEASE
| | | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | | +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.33
| | | +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.33
| | | \--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.33
| | | \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.33
| | +--- org.springframework.boot:spring-boot-starter-validation:2.2.6.RELEASE
| | | +--- org.springframework.boot:spring-boot-starter:2.2.6.RELEASE (*)
| | | +--- jakarta.validation:jakarta.validation-api:2.0.2
| | | \--- org.hibernate.validator:hibernate-validator:6.0.18.Final
| | | +--- org.jboss.logging:jboss-logging:3.3.2.Final -> 3.4.1.Final
| | | \--- com.fasterxml:classmate:1.3.4 -> 1.5.1
| | +--- org.springframework:spring-web:5.2.5.RELEASE (*)
| | \--- org.springframework:spring-webmvc:5.2.5.RELEASE
| | +--- org.springframework:spring-aop:5.2.5.RELEASE (*)
| | +--- org.springframework:spring-beans:5.2.5.RELEASE (*)
| | +--- org.springframework:spring-context:5.2.5.RELEASE (*)
| | +--- org.springframework:spring-core:5.2.5.RELEASE (*)
| | +--- org.springframework:spring-expression:5.2.5.RELEASE (*)
| | \--- org.springframework:spring-web:5.2.5.RELEASE (*)
| \--- org.springframework.hateoas:spring-hateoas:1.0.4.RELEASE
| +--- org.springframework:spring-aop:5.2.5.RELEASE (*)
| +--- org.springframework:spring-beans:5.2.5.RELEASE (*)
| +--- org.springframework:spring-context:5.2.5.RELEASE (*)
| +--- org.springframework:spring-core:5.2.5.RELEASE (*)
| +--- org.springframework:spring-web:5.2.5.RELEASE (*)
| +--- org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE
| | +--- org.springframework:spring-beans:5.2.0.RELEASE -> 5.2.5.RELEASE (*)
| | +--- org.springframework:spring-context:5.2.0.RELEASE -> 5.2.5.RELEASE (*)
| | +--- org.springframework:spring-aop:5.2.0.RELEASE -> 5.2.5.RELEASE (*)
| | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.30
| +--- 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
| \--- org.slf4j:slf4j-api:1.7.30
+--- org.springframework.boot:spring-boot-devtools -> 2.2.6.RELEASE
| +--- org.springframework.boot:spring-boot:2.2.6.RELEASE (*)
| \--- org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-web -> 2.2.6.RELEASE (*)
+--- javax.servlet:javax.servlet-api:3.1.0
\--- org.springframework.boot:spring-boot-starter-tomcat -> 2.2.6.RELEASE (*)
providedRuntime - Additional runtime classpath for libraries that should not be part of the WAR archive.
+--- javax.servlet:javax.servlet-api:3.1.0
\--- org.springframework.boot:spring-boot-starter-tomcat -> 2.2.6.RELEASE
+--- jakarta.annotation:jakarta.annotation-api:1.3.5
+--- org.apache.tomcat.embed:tomcat-embed-core:9.0.33
+--- org.apache.tomcat.embed:tomcat-embed-el:9.0.33
\--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.33
\--- org.apache.tomcat.embed:tomcat-embed-core:9.0.33

It doesn't require for a standalone jar application: providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'. Starter-web includes one
When you've declared this dependency you said you build to exclude tomcat for a standalone run. This means - no servlet library inside
If you deploy this app somewhere, then just exclude tomcat from starter-web, like this:
compile('org.springframework.boot:spring-boot-starter-web'){
exclude module: "spring-boot-starter-tomcat"
}

Related

Spring-Beans jar package is shown in the dependency tree, but is not imported

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

Confused with gradle select rule of dependency version

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"
}

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

How to list "compile" configuration's "provided" dependencies? I would like to download all of the dependencies

To list dependencies with gradle:
gradlew dependencies
This will show the all of the dependencies in your current projects configurations.
For example:
testCompile - Classpath for compiling the test sources.
+--- org.robolectric:shadows-support-v4:3.1.2
| +--- org.robolectric:robolectric:3.1.2
| | +--- org.robolectric:robolectric-annotations:3.1.2
| | +--- org.robolectric:robolectric-resources:3.1.2
| | | +--- org.robolectric:robolectric-utils:3.1.2
| | | | +--- org.ow2.asm:asm:5.0.1
| | | | +--- org.ow2.asm:asm-commons:5.0.1
| | | | | \--- org.ow2.asm:asm-tree:5.0.1
| | | | | \--- org.ow2.asm:asm:5.0.1
| | | | +--- org.robolectric:robolectric-annotations:3.1.2
| | | | \--- com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.1
| | | | +--- org.hamcrest:hamcrest-core:1.3
| | | | +--- org.hamcrest:hamcrest-library:1.3
| | | | | \--- org.hamcrest:hamcrest-core:1.3
| | | | \--- com.google.protobuf:protobuf-java:2.6.1
| | | +--- org.robolectric:robolectric-annotations:3.1.2
| | | +--- com.ximpleware:vtd-xml:2.11
| | | \--- com.google.guava:guava:19.0
| | +--- org.robolectric:robolectric-utils:3.1.2 (*)
| | +--- org.ow2.asm:asm:5.0.1
| | +--- org.ow2.asm:asm-util:5.0.1
| | | \--- org.ow2.asm:asm-tree:5.0.1 (*)
| | +--- org.ow2.asm:asm-commons:5.0.1 (*)
| | +--- org.ow2.asm:asm-analysis:5.0.1
| | | \--- org.ow2.asm:asm-tree:5.0.1 (*)
| | +--- org.bouncycastle:bcprov-jdk16:1.46
| | +--- com.ximpleware:vtd-xml:2.11
| | +--- com.thoughtworks.xstream:xstream:1.4.8
| | | +--- xmlpull:xmlpull:1.1.3.1
| | | \--- xpp3:xpp3_min:1.1.4c
| | +--- org.apache.ant:ant:1.8.0
| | | \--- org.apache.ant:ant-launcher:1.8.0
| | +--- org.apache.maven:maven-ant-tasks:2.1.3
| | | +--- org.apache.ant:ant:1.8.0 (*)
| | | +--- classworlds:classworlds:1.1-alpha-2
| | | +--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1
| | | | +--- junit:junit:3.8.1 -> 4.12 (*)
| | | | +--- org.codehaus.plexus:plexus-utils:1.0.4 -> 1.5.15
| | | | \--- classworlds:classworlds:1.1-alpha-2
| | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | +--- org.apache.maven:maven-artifact:2.2.1
| | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | +--- org.apache.maven:maven-artifact-manager:2.2.1
| | | | +--- org.apache.maven:maven-repository-metadata:2.2.1
| | | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | +--- org.apache.maven:maven-artifact:2.2.1 (*)
| | | | +--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | +--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6
| | | | | \--- org.codehaus.plexus:plexus-utils:1.4.2 -> 1.5.15
| | | | \--- backport-util-concurrent:backport-util-concurrent:3.1
| | | +--- org.apache.maven:maven-model:2.2.1
| | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | +--- org.apache.maven:maven-project:2.2.1
| | | | +--- org.apache.maven:maven-settings:2.2.1
| | | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | +--- org.apache.maven:maven-profile:2.2.1
| | | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | +--- org.apache.maven:maven-artifact-manager:2.2.1 (*)
| | | | +--- org.apache.maven:maven-plugin-registry:2.2.1
| | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | +--- org.apache.maven:maven-artifact:2.2.1 (*)
| | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | +--- org.apache.maven:maven-error-diagnostics:2.2.1
| | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | +--- org.apache.maven:maven-settings:2.2.1 (*)
| | | +--- org.apache.maven.wagon:wagon-file:1.0-beta-6
| | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | +--- org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-6
| | | | +--- org.apache.maven.wagon:wagon-http-shared:1.0-beta-6
| | | | | +--- nekohtml:xercesMinimal:1.9.6.2
| | | | | +--- nekohtml:nekohtml:1.9.6.2
| | | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | \--- org.robolectric:shadows-core-v23:3.1.2
| | +--- org.robolectric:robolectric-annotations:3.1.2
| | +--- org.robolectric:robolectric-resources:3.1.2 (*)
| | +--- org.robolectric:robolectric-utils:3.1.2 (*)
| | +--- com.almworks.sqlite4java:sqlite4java:0.282
| | \--- com.ibm.icu:icu4j:53.1
| \--- org.robolectric:shadows-core-v23:3.1.2 (*)
Notice, the shadows-support-v4 artifact brings in robolectric artifact which brings in the dependency: org.robolectric:shadows-core-v23:3.1.2.
If we go to the build.gradle file, we notice there are provided dependencies that are not brought in: https://github.com/robolectric/robolectric/blob/f68ba6bcb51fb25a28805a3c5f7ffcee2d9560d5/robolectric-shadows/shadows-core/build.gradle#L16.
Actual pom file: http://repo1.maven.org/maven2/org/robolectric/robolectric/3.1.2/robolectric-3.1.2.pom. Provided dependencies are not added to the POM but the runtime dependencies are.
How can I go deeper and list all of the dependencies of the dependencies including any provided dependencies?
I answered this here: https://github.com/robolectric/robolectric/issues/2646
For those that are still having this problem, download all the dependencies and transitive dependencies up front for your CI:
subprojects { project ->
task downloadDependencies(type: Copy) {
description "Downloads all dependencies."
group "build"
from {
// Use of closure defers evaluation until execution time
project.configurations
.findAll { configuration -> configuration.canBeResolved }
.collect { configuration -> configuration.resolvedConfiguration.lenientConfiguration.files }
}
into "$project.buildDir/dependencies"
}
}
Example:
Step 1: gradlew downloadDependencies
Step 2: gradlew assembleDebug testDebug

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