spring boot war without tomcat embedded

后端 未结 5 1617
孤街浪徒
孤街浪徒 2020-11-28 10:23

I want to create a war file without embedded tomcat with maven. Here the relevant part of my pom

...

    org.springframework.bo         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 11:03

    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:

    
        
            ...
            
                org.apache.maven.plugins
                maven-war-plugin
                2.4
                
                    WEB-INF/lib/tomcat-*.jar
                
            
        
    
    

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

提交回复
热议问题