Skip to content

Instantly share code, notes, and snippets.

Last active June 8, 2022 11:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
surefire issue with modules
foo-slf4-impl: with a particular class
requires transitive org.slf4j;
provides org.slf4j.spi.SLF4JServiceProvider with;
foo-util: foo-slf4-impl as scope test
some class in src/test/java use
module {
requires org.slf4j;
slf4j-api 2.0.0-alpha6 has module-info
module org.slf4j {
uses org.slf4j.spi.SLF4JServiceProvider;
but error
(in module cannot access class (in module
because module does not read module
module is added to module-path because it provides org.slf4j.spi.SLF4JServiceProvider whereas it is a test scope dependency.
easy solution is to add `--add-reads`
but this doesn't look right. Shouldn't we have all test scope/provided dependencies only in classpath (and not module-path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment