How to use undertow instead of tomcat when using cxf-spring-boot-starter-jaxrs

Solution Verified - Updated -

Issue

How to use undertow instead of tomcat when using cxf-spring-boot-starter-jaxrs?

In pom.xml, I thought I can set this to use undertow
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-undertow</artifactId>
        </dependency> 

However, it still start with tomcat

java -jar target/spring-boot-cxf-jaxrs-1.0-SNAPSHOT.jar

2023-04-01 11:34:14.778  INFO 16043 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-04-01 11:34:14.802  INFO 16043 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-04-01 11:34:14.803  INFO 16043 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.59]
2023-04-01 11:34:14.942  INFO 16043 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-04-01 11:34:14.942  INFO 16043 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3587 ms

Environment

Fuse 7.11.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content