Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

maven-2

cxf

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?

like image 639
Jared Avatar asked Jan 27 '10 17:01

Jared


2 Answers

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>
like image 92
bmargulies Avatar answered Oct 27 '22 21:10

bmargulies


Point to the artifacts you need:

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-api</artifactId>
    <version>2.1.3</version>
    <type>jar</type>
</dependency>
like image 41
rodrigoap Avatar answered Oct 27 '22 22:10

rodrigoap