Skip to main content
Consequence of using maven war plugin instead of spring boot plugin
Source Link

I'm not sure if that's the spring-boot way of doing it, but you can exclude the tomcat jars using the maven-war-plugin configuration. That is, add the following to your pom.xml:

<build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> </configuration> </plugin> </plugins> </build> 

Using this approach, the war generated is not executable (cannot be run on command line using java -jar <warfileName.war>) but can only be deployed to any servlet container

I'm not sure if that's the spring-boot way of doing it, but you can exclude the tomcat jars using the maven-war-plugin configuration. That is, add the following to your pom.xml:

<build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> </configuration> </plugin> </plugins> </build> 

I'm not sure if that's the spring-boot way of doing it, but you can exclude the tomcat jars using the maven-war-plugin configuration. That is, add the following to your pom.xml:

<build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> </configuration> </plugin> </plugins> </build> 

Using this approach, the war generated is not executable (cannot be run on command line using java -jar <warfileName.war>) but can only be deployed to any servlet container

Source Link
Yonatan
  • 2.5k
  • 2
  • 19
  • 20

I'm not sure if that's the spring-boot way of doing it, but you can exclude the tomcat jars using the maven-war-plugin configuration. That is, add the following to your pom.xml:

<build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> </configuration> </plugin> </plugins> </build>