I am working on an Eclipse based project that recently switched from Java 1.8 to Java 11. Due to that we have now a conflict between classes from the JRE and classes that are introduced from Eclipse plugin dependencies.
The package javax.xml.parsers is accessible from more than one module: <unnamed>, java.xml
So the java.xml.* classes are now present twice. once from the module java.xml and once due to a dependency from our plugin to org.eclipse.wst.xml.core
org.eclipse.wst.xml.core -> org.apache.xerces -> javax.xml
What I would like to do is exclude the module java.xml or the bundle javax.xml from being included in the build. I found this post with an explanation on how to exclude the module but for multiple reasons I can't do it like this:
- many other modules depend on java.xml. removing this creates even more issues
- The mavan tycho build sees not to care what I do with the eclipse project module settings.
At this point I think the best solution is to exclude javax.xml from being included in the build but I was unable to find a way how to do this inside eclipse and for the tycho build.
Does anyone know how to exclude a dependency to a plugin from Eclipse build/Tycho build? Or is there another way to resolve module/osgi conflicts like this?