查找Spring Boot内嵌Tomcat的版本
在gradlew所在的目录中执行以下命令。
运行以下命令获取依赖项:./gradlew dependencies –configuration compile
通过列举依存关系并且嵌入Tomcat中,可以知道在我的环境中,所使用的是8.5.11版本的。
dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
compile - Dependencies for source set 'main' (deprecated, use 'implementation ' instead).
+--- org.springframework.boot:spring-boot-starter-web: -> 1.5.2.RELEASE
| +--- org.springframework.boot:spring-boot-starter:1.5.2.RELEASE
| | +--- org.springframework.boot:spring-boot:1.5.2.RELEASE
| | | +--- org.springframework:spring-core:4.3.7.RELEASE
| | | \--- org.springframework:spring-context:4.3.7.RELEASE
| | | +--- org.springframework:spring-aop:4.3.7.RELEASE
| | | | +--- org.springframework:spring-beans:4.3.7.RELEASE
| | | | | \--- org.springframework:spring-core:4.3.7.RELEASE
| | | | \--- org.springframework:spring-core:4.3.7.RELEASE
| | | +--- org.springframework:spring-beans:4.3.7.RELEASE (*)
| | | +--- org.springframework:spring-core:4.3.7.RELEASE
| | | \--- org.springframework:spring-expression:4.3.7.RELEASE
| | | \--- org.springframework:spring-core:4.3.7.RELEASE
| | +--- org.springframework.boot:spring-boot-autoconfigure:1.5.2.RELEASE
| | | \--- org.springframework.boot:spring-boot:1.5.2.RELEASE (*)
| | +--- org.springframework.boot:spring-boot-starter-logging:1.5.2.RELEASE
| | | +--- ch.qos.logback:logback-classic:1.1.11
| | | | +--- ch.qos.logback:logback-core:1.1.11
| | | | \--- org.slf4j:slf4j-api:1.7.22 -> 1.7.24
| | | +--- org.slf4j:jcl-over-slf4j:1.7.24
| | | | \--- org.slf4j:slf4j-api:1.7.24
| | | +--- org.slf4j:jul-to-slf4j:1.7.24
| | | | \--- org.slf4j:slf4j-api:1.7.24
| | | \--- org.slf4j:log4j-over-slf4j:1.7.24
| | | \--- org.slf4j:slf4j-api:1.7.24
| | +--- org.springframework:spring-core:4.3.7.RELEASE
| | \--- org.yaml:snakeyaml:1.17
| +--- org.springframework.boot:spring-boot-starter-tomcat:1.5.2.RELEASE
| | +--- org.apache.tomcat.embed:tomcat-embed-core:8.5.11
| | +--- org.apache.tomcat.embed:tomcat-embed-el:8.5.11
| | \--- org.apache.tomcat.embed:tomcat-embed-websocket:8.5.11
| | \--- org.apache.tomcat.embed:tomcat-embed-core:8.5.11
| +--- org.hibernate:hibernate-validator:5.3.4.Final
| | +--- javax.validation:validation-api:1.1.0.Final
| | +--- org.jboss.logging:jboss-logging:3.3.0.Final
| | \--- com.fasterxml:classmate:1.3.1 -> 1.3.3
| +--- com.fasterxml.jackson.core:jackson-databind:2.8.7
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.8.0
| | \--- com.fasterxml.jackson.core:jackson-core:2.8.7
| +--- org.springframework:spring-web:4.3.7.RELEASE
| | +--- org.springframework:spring-aop:4.3.7.RELEASE (*)
| | +--- org.springframework:spring-beans:4.3.7.RELEASE (*)
| | +--- org.springframework:spring-context:4.3.7.RELEASE (*)
| | \--- org.springframework:spring-core:4.3.7.RELEASE
| \--- org.springframework:spring-webmvc:4.3.7.RELEASE
| +--- org.springframework:spring-aop:4.3.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.3.7.RELEASE (*)
| +--- org.springframework:spring-context:4.3.7.RELEASE (*)
| +--- org.springframework:spring-core:4.3.7.RELEASE
| +--- org.springframework:spring-expression:4.3.7.RELEASE (*)
| \--- org.springframework:spring-web:4.3.7.RELEASE (*)
+--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1
| \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.1
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.1
| \--- org.jetbrains:annotations:13.0
\--- org.jetbrains.kotlin:kotlin-reflect:1.1.1
\--- org.jetbrains.kotlin:kotlin-stdlib:1.1.1 (*)
(*) - dependencies omitted (listed previously)
BUILD SUCCESSFUL
如果您使用的是最新版本,您也可以在此找到确认的资料:
http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#appendix-dependency-versions
你可以在Maven仓库中查找一下,确认一下:
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/1.2.3.RELEASE/spring-boot-dependencies-1.2.3.RELEASE.pom
嗯,Gradle真方便。