How can I include apache-cxf as a dependency in my Maven pom?

cxf, java, maven-2

Solution

See the samples. What you did was depend on the aggregate project, and that has no effect.

Typical is :

  <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <!-- Jetty is needed if you're using the CXFServlet -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>${cxf.version}</version>
        </dependency>

Problem

Apache CXF "syncs" their releases to the Maven central repository. When I look at the CXF entries, there are no jar files, just the pom. If I include the following section in my pom, the build fails because it can't download the cxf dependency: ``` <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf</artifactId> <version>2.1.3</version> <type>jar</type> </dependency> ``` If I change the type to "pom," the build succeeds, but the appropriate jars are not downloaded (and thus, obviously, not included in the package.) What am I missing?

Original source