I have a new Java application that is module based. I need to pull in two dependencies (one module based - sqlite - and one that is not - commonutilities) but both contain transient dependencies to the org.slf4j package.
I know that in the pre-module era, you'd simply include an exclusion element in your pom file's dependency element to exclude the package from one of the two JARs.
Is there a similar mechanism in the module world where you can exclude a transient dependency? Or, how do I resolve this?
The error trace is:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project MonthlyFinances: Compilation failure: Compilation failure:
[ERROR] the unnamed module reads package org.slf4j.spi from both org.slf4j and CommonUtilities
[ERROR] the unnamed module reads package org.slf4j.helpers from both org.slf4j and CommonUtilities
[ERROR] the unnamed module reads package org.slf4j.event from both org.slf4j and CommonUtilities
[ERROR] the unnamed module reads package org.slf4j from both org.slf4j and CommonUtilities
[ERROR] module org.slf4j reads package org.slf4j from both CommonUtilities and org.slf4j
[ERROR] module org.slf4j reads package org.slf4j.spi from both CommonUtilities and org.slf4j
[ERROR] module org.slf4j reads package org.slf4j.helpers from both CommonUtilities and org.slf4j
[ERROR] module org.slf4j reads package org.slf4j.event from both CommonUtilities and org.slf4j
[ERROR] module org.xerial.sqlitejdbc reads package org.slf4j.spi from both org.slf4j and CommonUtilities
[ERROR] module org.xerial.sqlitejdbc reads package org.slf4j.helpers from both org.slf4j and CommonUtilities
[ERROR] module org.xerial.sqlitejdbc reads package org.slf4j.event from both org.slf4j and CommonUtilities
[ERROR] module org.xerial.sqlitejdbc reads package org.slf4j from both org.slf4j and CommonUtilities
[ERROR] module CommonUtilities reads package org.slf4j.spi from both org.slf4j and CommonUtilities
[ERROR] module CommonUtilities reads package org.slf4j.helpers from both org.slf4j and CommonUtilities
[ERROR] module CommonUtilities reads package org.slf4j.event from both org.slf4j and CommonUtilities
[ERROR] module CommonUtilities reads package org.slf4j from both org.slf4j and CommonUtilities
[ERROR] /D:/NonGitRepo/MonthlyFinances/src/main/java/module-info.java:[1,1] module org.sperbolink.monthlyfinances reads package org.slf4j from both CommonUtilities and org.slf4j
requires static, but that is something determined by the module at compile-time, not by the project pulling in the library.