How to Know Which Tomcat Version Embedded in Spring Boot

How to know which tomcat version embedded in spring boot

Via http://search.maven.org/, in https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/1.2.5.RELEASE/spring-boot-dependencies-1.2.5.RELEASE.pom:

<tomcat.version>8.0.23</tomcat.version>

Change the version of the embedded tomcat using spring starter

If you're not inheriting from spring-boot-starter-parent I can only guess that you import spring-boot-dependencies in your dependencies management somewhere.

The documentation covers what you need to do to override the tomcat version. Each tomcat artifact should be listed with the overridden version, before you imports spring-boot-dependencies. The list of artifacts can be found in spring-boot-dependencies.

Using a different version of the starter is wrong (you can't mix two Spring Boot versions in the same app) and will have no effect since dependency management is in control anyway. In other words, you'll get spring-boot-starter-web version 2.3.2.RELEASE indeed but all the artefacts that it brings will be managed by the dependency management (the tomcat version defined by version 2.2.6.RELEASE).

In that particular case of yours, upgrading to 2.2.9.RELEASE could also be an option as it provides dependency management for the tomcat version that you need.

How to change embedded tomcat's version in existing spring boot app?

If you are using spring boot gradle plugin and spring boot starters ..you can customise the version by setting maven project properties in build.gradle.

ext['tomcat.version'] = '9.0.45'

for maven

<properties>
<tomcat.version>9.0.45</tomcat.version>
<properties>

You can find all the external dependencies that can be customised in spring-boot-dependencies



Related Topics



Leave a reply



Submit