如何在 Spring Boot 应用程序中排除嵌入的 Tomcat [英] How to exclude embeded Tomcat in Spring Boot application

查看:111
本文介绍了如何在 Spring Boot 应用程序中排除嵌入的 Tomcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何从 Spring Boot 应用程序中排除嵌入式 Tomcat 服务器,以便我们可以在 JBoss 服务器上运行该 jar?

How can we exclude embedded Tomcat server from Spring Boot application so that we can run that jar on JBoss Server?

推荐答案

可以在pom文件中排除:

You can exclude in pom file:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <exclusion>
            <artifactId>tomcat-embed-el</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
        </exclusion>
        <exclusion>
            <artifactId>tomcat-embed-core</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
        </exclusion>
        <exclusion>
            <artifactId>tomcat-embed-websocket</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
        </exclusion>
    </exclusions>
</dependency>

你可以按照这个链接截图

Spring 文档在嵌入式 servlet 容器上

这篇关于如何在 Spring Boot 应用程序中排除嵌入的 Tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆