Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 3. Configuring Maven Dependencies

This chapter provides information for using the Apache CXF component with Kie-Camel.

Integrating Apache CXF with Kie-Camel

To support both EAP and Karaf containers, kie-camel should support Apache CXF 2.7.x and 3.x versions. Each version might contain different packages, classes, and methods. In your project, if you are using both kie-camel and Apache CXF, the application might display a few classpath collision errors. To avoid this, Red Hat recommends that you exclude the artifacts whose version does not match the container version, and replace them with artifacts whose version matches the version of Apache CXF in your container.
  • EAP 6.4.x: You can define eap.cxf.version in properties with the Apache CXF version that is in your EAP container.
    
    <dependency>
        <groupId>org.jboss.integration.fuse</groupId>
        <artifactId>kie-camel</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-core</artifactId>
        <version>${eap.cxf.version}</version>
    </dependency>
    
  • Fuse on Karaf: Define karaf.cxf.version in properties with Apache CXF version that is in your Fuse/Karaf container.
    
    <dependency>
        <groupId>org.jboss.integration.fuse</groupId>
        <artifactId>kie-camel</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-rs-security-oauth</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxws</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-features-clustering</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-bindings-soap</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-rs-security-oauth</artifactId>
        <version>${karaf.cxf.version}
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${karaf.cxf.version}
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxrs</artifactId>
        <version>${karaf.cxf.version}
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-features-clustering</artifactId>
        <version>${karaf.cxf.version}
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-bindings-soap</artifactId>
        <version>${karaf.cxf.version}
    </dependency