Hello all,

The logback project, more specifically logback-classic, offers the possibility of configuration via a script written in Groovy. Thus, logback-classic has source files written in Java and a few source files in Groovy.

While attempting to (Jigsaw) modularize the logback project, I first tried to declare "requires static groovy" in logback-classic's module-info.java file but the compiler was unable to load groovy-2.4.13.jar as an auto-module.

To get the ball rolling, I had to resort to the "--add-reads ch.qos.logback.classic=ALL-UNNAMED" compiler directive. This is very unsatisfactory.

On twitter, Cédric Champeau‏ suggested manually editing MANIFEST.MF in groovy-2.4.13.jar adding "Automatic-Module-Name: groovylang". I edited the file and also declared "requires static groovylang" in logback-classic's module-info.java. However, this did not help and I still get "module not found: groovylang"

Building with maven's -X option, I see that groovy-2.4.13.jar ends up on the compiler's class path instead of the module path.

Still on twitter, Robert Scolte responded that m-compiler-p only puts the jars on the module path if they are referred to by a requires statement anywhere in the module descriptors tree. The rest ends up on the classpath.

I am assuming here that "module descriptors tree" refers to module-info.java files and not dependency declarations in pom.xml files. Thus, if I understand correctly m-compiler-p parses module-info.java files before invoking javac. Really?

Best regards,

--
Ceki Gülcü


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to