Slackbot
03/17/2022, 12:39 PMRobert Elliot
03/17/2022, 12:39 PMimplementation
scoped dependencies any more than I care about your private
classes and methods.)
• I am really keen to avoid another metadata file. It's bad enough needing to keep Gradle dependencies & module-info.java
in sync. So Layrry for instance feels overkill.
• I am really keen to make it transparent to the end user - they should still call java --module-path ... --module
or java -jar
. If the classpath / modulepath can be specified in META-INF or similar so much the better
• I'd like it to be as light touch as possible in code - ideally a single call at the start of a main
method that would kick everything into this new world.Robert Elliot
03/17/2022, 12:45 PMModuleLayer
, but I can't find a decent example of using it for what I want.Robert Elliot
03/17/2022, 2:55 PMJendrik Johannes
03/17/2022, 4:37 PMIt’s bad enough needing to keep Gradle dependencies &Maybe interesting for you. I still have to finde the time to polish that up more and make some things more configurable. Feedback is always welcome. https://github.com/jjohannes/java-module-dependenciesin sync.module-info.java
Jendrik Johannes
03/17/2022, 4:38 PMcompileClasspath
and writes that into a file you read at runtime to setup your classloading. It will be challenging to decide what to do if you also have sitations with “API dependencies” - I don’t think it’s trivial to implement something like this from scratch. Maybe Layrry is something you can use (I am not familiar with it), but generate the Layrry file with Gradle.Robert Elliot
03/17/2022, 4:55 PMRobert Elliot
03/17/2022, 4:57 PMJendrik Johannes
03/17/2022, 6:39 PMrequires
-> implementation
requires transitive
-> api
requires static
-> compileOnly
requires static transitive
-> compileOnlyApi
Robert Elliot
03/17/2022, 6:56 PMRobert Elliot
03/17/2022, 6:57 PMRobert Elliot
03/17/2022, 7:08 PMJendrik Johannes
03/18/2022, 7:05 AM