Maven: Multiple class with the same path implemented in different jar

Posted by Phuong Nguyen de ManCity fan on Stack Overflow See other posts from Stack Overflow or by Phuong Nguyen de ManCity fan
Published on 2010-04-10T08:21:30Z Indexed on 2010/04/10 8:23 UTC
Read the original article Hit count: 270

Filed under:
|

I'm running into trouble with having multiple class with the same path (i.e. same name, same package!!!). For some reason, gwt-dev comes with its own version of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl and javax.xml.parsers.DocumentBuilderFactory.

At the same time, spring also depends on these classes but from different jar. I don't know what should be, but look like xalan & xml-api are the two dependencies that spring depends on (these dependency are optional)

Funny thing is that eclipse can run the same code (it's a unit test) without problem, but surefire cannot. So I guess the problem is due to the way each runner consider the priority of each jar.

Now come to the question: How can I setup my POM so that I can sure that when ever any code running inside my app, then class from a jar will be selected over class from other jar?

Thanks.

© Stack Overflow or respective owner

Related posts about maven

Related posts about dependencies