Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.4
-
None
-
tested on solaris, linux and windows
Description
In my POM I added "xerces:xercesImpl:2.8.0" as compile dependency what depends on "xml-apis:xml-apis:1.3.03".
Since I also have "commons-betwixt:commons-betwixt:0.7", "commons-configuration:commons-configuration:1.2", and "ant:ant:1.6.5" as dependencies that also depend on "xml-apis" but in different versions I came into trouble.
Since one of theses "xml-apis" dependencies has a higher version number (but is the JAR of an earlier version) maven does not decide for "1.3.03" which is correct behaviour for maven. Anyways I got
NoClassDefFoundError: org/w3c/dom/DOMError
when I run my tests with XmlUnit.
Now here comes the problem:
I added the following XML snipplet to all dependencies that depend on xml-apis except for xercesImpl.
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
This caused maven NOT to include the dependency on "xml-apis" at all.
This was hard to track because the "org/w3c/dom/DOMError" did not occure on evey machine involved in the project.
I figured out that the ones having no trouble used jdk1.5 that has this code included inside (JAXP 1.3).
With jdk1.4.2 this bug was reproducable on any operating system.
Now it comes even harder:
I added
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.3.03</version>
</dependency>
as toplevel dependency to the POM and still maven did NOT include this dependency when running the test.
The funny thing is that "mvn eclipse:eclipse" produced the right dependency in my IDE.
Anyways in the dependency report on the site it was missing.
I additionally had to remove all the exclusion tags to make it work again.
To me it looks like the handling of the <exclusion> tag is broken,
meaning that it does NOT work as I expected.
I hope that this behaviour is NOT intendet.
Best Regards Jörg
Attachments
Issue Links
- duplicates
-
MNG-1797 Dependency excludes apply to every subsequent dependency, not just the one it is declared under.
- Closed