tomcatspring-bootembedded-tomcat-8

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


I'm currently running spring-boot version 1.4.0.RELEASE application with embedded tomcat. Included Tomcat's version is 8.5.4

There's a need to update the tomcat version to 9.x. When I looked at mvnrepository here, I found that there's an update available to tomcat version 9.0.5 (shown in pic below)

enter image description here

How should I use this version in my project if there's no way to directly mention this version in my pom.xml?

I do not want to go the traditional deployment route (WAR artifacts on external tomcats).


Solution

  • 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