Issue
Wanted to modularize the whole application, i.e. to migrate from Java 8 to Java 11, but with the modularity some dependency conflicts appeared.
These both jars are having the same name packages so that causes 100 + compilation errors with:
[ERROR] error: module java.xml.bind reads package org.jdbi.v3.core from both org.jdbi.v3.core and ru.vyarus.dropwizard.guicey.jdbi3
messages.
Tried to exclude from ru.vyarus.dropwizard.guicey.jdbi3 org.jdbi.v3 using Maven but it did not work
<dependency>
<groupId>ru.vyarus.guicey</groupId>
<artifactId>guicey-jdbi3</artifactId>
<exclusions>
<exclusion>
<groupId>org.jdbi</groupId>
<artifactId>jdbi3-core</artifactId>
</exclusion>
</exclusions>
</dependency>
Please advise.
Solution
Well, deep dive into Java 9 gives the most basic answer, it's all about
split packages issue
that should be solved.
Very interesting solutions are proposed in the section How to Fix the Split Package Issue.
Answered By - Bella Galoyan