Search code examples
springspring-bootswaggercxfswagger-ui

Unable to run swagger with CXF on top of spring boot Application


Unable to run swagger with CXF on top of spring boot Application, but it's working fine with spring rest web service.


Solution

  • Below Jars were conflicting with spring boot jars. Just removed below-mentioned jars.

            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxrs</artifactId>
                <version>3.1.13</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-transports-http</artifactId>
                <version>3.1.13</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-ws-policy</artifactId>
                <version>3.1.13</version>
            </dependency>
    
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-wsdl</artifactId>
                <version>3.1.13</version>
            </dependency>
    Added below spring boot jars.
    
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
                <version>${cxf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
                <version>${cxf.version}</version>
            </dependency>