Sunday, December 14, 2008

Bookmark and Share

While trying to build a Maven based project using JAX-WS RI 2.1.5, I noticed, that Maven tried to download the artifact wstx-asl-3.2.3.pom upon each build. Unfortunately without much success, but resulting in an increased build time.

As it turned out, the dependency to the Woodstox XML processor in JAX-WS RI's pom.xml is apparently wrong. There is also an item at JAX-WS RI's issue tracker commenting on that problem.

Until this is fixed, you can help yourself by excluding the flawed dependency in your project's pom.xml and adding the correct one:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
<dependencies>
    ...
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.1.5</version>
        <exclusion>
            <exclusion>
                <groupId>woodstox</groupId>
                <artifactId>wstx-asl</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.codehaus.woodstox</groupId>
        <artifactId>wstx-asl</artifactId>
        <version>3.2.3</version>
    </dependency>
    ...
</dependencies>
...

In the likely case, that you are also using the JAX-WS Maven plugin, you have to circumvent the bug in the plugin's dependencies as well:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
...
<build>
    ...
    <plugins>
        ...
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <executions>
            ...
            </executions>
            <dependencies>
                <!-- Use current JAX-WS RI version -->
                <dependency>
                    <groupId>com.sun.xml.ws</groupId>
                    <artifactId>jaxws-tools</artifactId>
                    <version>2.1.5</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.ws</groupId>
                    <artifactId>jaxws-rt</artifactId>
                    <version>2.1.5</version>
                    <exclusions>
                        <exclusion>
                            <groupId>woodstox</groupId>
                            <artifactId>wstx-asl</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.woodstox</groupId>
                    <artifactId>wstx-asl</artifactId>
                    <version>3.2.3</version>
                </dependency>
            </dependencies>
        </plugin>
        ...
    </plugins>
    ...
</build>
...

Having pimped your pom.xml as described above, Maven should stop wasting your time by trying to resolve the flawed dependency over and over again.

No comments: