springboot学习五:IDEA外部tomcat发布

 pom.xml配置

屏蔽自带tomcat

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

打包形式改成war包

<packaging>war</packaging>

IDEA操作

tomcat推荐使用8.5

war exploded和war区别:

war模式:将web工程以war包的形式上传到服务器 
war exploed模式:将web工程以当前文件夹的位置关系上传到服务器

参考:https://blog.csdn.net/weixin_36210698/article/details/72585429

运行tomcat就可以了

原文地址:https://www.cnblogs.com/ctsx/p/10275976.html