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

shankulk picture shankulk · Mar 9, 2018 · Viewed 19.7k times · Source

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).

Answer

ptrk picture ptrk · Jul 18, 2018

Late to the party I know, was looking for a similar issue, thought I'd share a more literal hint.

You need to override the properties set in spring's parent pom (which is mandatory for this) to suit your case (and compatibility too):

<properties>
......
    <tomcat.version>9.0.5</tomcat.version>
......
<properties>

This is according to [Introduction to Spring][1]. Their example shows many other dependencies cherry-picked. [1]: http://www.springboottutorial.com/spring-boot-starter-parent