spring-boot - spring boot 由 jetty 而不是 tomcat 启动,需要做什么?

标签 spring-boot tomcat jetty

现在,gradle 是

configurations {
    compile.exclude module: "spring-boot-starter-tomcat"
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-data-redis')
    compile 'org.springframework.boot:spring-boot-starter-data-jpa'
    compile 'org.springframework.boot:spring-boot-starter-jersey'
    compile 'org.springframework.boot:spring-boot-starter-web'
    compile('org.springframework.boot:spring-boot-starter-jetty')
}

但是tomcat的依赖还是存在的 enter image description here enter image description here

最佳答案

请根据 reference 更正在您的 gradle 中排除 Tomcat 时的引号:

configurations {
    compile.exclude module: 'spring-boot-starter-tomcat'
}

然后清理并构建项目。

然后确认 Tomcat 依赖项不存在。

关于spring-boot - spring boot 由 jetty 而不是 tomcat 启动,需要做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53043501/

相关文章:

java - 在 Spring Boot 中使用 MDC 或任何过滤器屏蔽日志消息中的密码,而不使用 logback.xml 文件

java - 所需的字符串参数 'x' 不存在

java.lang.NoSuchMethodError : org. apache.tomcat.util.res.StringManager.getManager with tomcat in Spring hetos

tomcat server.xml加密密码

java - 嵌入式 jetty 的多个实例

tomcat - 如何在没有内置 jetty 的情况下运行 cxf jax-ws(改为使用 tomcat)

java - 带 @Conditional 的完全限定类名

java - 使用 RestTemplate 调用 API 时如何捕获超时异常

java - 使用 cargo maven 插件将 spring 项目部署到远程服务器

Java:java.lang.NoClassDefFoundError