When trying to setup a project with a Java version > 9 I came across a problem with dependencies and the Java module system. I know that there are some posts regarding this topic (e.g. this one or this one), but the solutions (exclude packages from dependencies) don't seem to help in my case.
On some imports related to XML parsing, I get the following error The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml
I used the "Open Type" dialog and found that there are in fact two providers for e.g. org.w3c.dom.Document.
This rmlmapper-4.9.1.jar is currently the only maven dependency in my project and I tried to exclude xml-apis as suggested here. I also added org.w3c.dom as you can see.
<dependencies>
<dependency>
<groupId>be.ugent.rml</groupId>
<artifactId>rmlmapper</artifactId>
<version>4.9.1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>org.w3c</groupId>
<artifactId>dom</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
Unfortunately, this doesn't help and the error persists. Note that I can build the project but get errors at runtime. Am I excluding the wrong packages? I couldn't find a package providing org.w3c.dom
using mvn dependency:tree
so how can I find the packages that need to be excluded?