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'] = '8.5.34'
You can find all the external dependencies that can be customised in spring-boot-dependencies