2

I want to downgrade my embedded tomcat from 8.5.6 to 8.5.51.

In my logs, I can find the information below:

"spring-boot-starter-tomcat/1.4.3.RELEASE/spring-boot-starter-tomcat-1.4.3.RELEASE.jar" ".m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.6/tomcat-embed-core-8.5.6.jar"

But in my pom.xml files, I do not have any references to tomcat.

Doing a grep command, there is no return to 'spring-boot-starter-parent' or 'spring-boot-starter-tomcat'.

Where and how can I explicitly add the tomcat version I want?

2 Answers2

3

if your project or one of your dependencies needs to override the version of a transitive dependency that is managed by the parent POM, just add a version property for that dependency. For this rule to work the parent POM has to define version properties for all the dependencies that it manages (the spring-boot-starter-parent does this).

<properties>
        <tomcat.version>8.5.51</tomcat.version>
</properties>
aballaci
  • 1,043
  • 8
  • 19
0

You can check where that dependency is coming from by looking at the dependency tree:

mvn dependency:tree -Dverbose 

More info here.

Another option is to explicitly set the version in your pom.xml file or exclude it from the dependency that is including it:

<dependency>
  <groupId>a.group</groupId>
  <artifactId>a.artifact</artifactId>
  <version>a.version</version>
  <exclusions>
    <exclusion>
      <artifactId>tomcat</artifactId>
      <groupId>tomcat-group</groupId>
    </exclusion>
  </exclusions>
<dependency>

More info here.

zlandorf
  • 1,100
  • 11
  • 15