简体   繁体   中英

Unable to start spring-boot in jetty and it always defaults to tomcat

Unable to start spring-boot in jetty even with the following configuration, what is not being configured properly

implementation ('org.springframework.boot:spring-boot-starter-web') {
    exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}   
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'

You need to add below code in your build.gradle to exclude Tomcat.

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

and then to add Jetty dependecy:

implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'

And this will start your Spring Boot app with Jetty.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM