Declare a module name for use with JPMS
Closed this issue · 8 comments
It would be nice for TerminalConsoleAppender to add a module descriptor (i.e. module-info.java), or at the very least, an Automatic-Module-Name during the interim before a full module descriptor is added.
The Velocity proxy, which uses TCA, has a possible future plan to use Jigsaw modules (I am not affiliated with that project however).
I know nothing about all the module stuff introduced in newer Java versions. Contributions welcome (preferably by someone who has experience with this)!
For now, I've opened #22 to add an automatic module name. Here's an accurate and concise introduction to the module system focusing on library maintainers: http://branchandbound.net/blog/java/2017/12/automatic-module-name/
Full support for the module system would mean providing a module descriptor. Since module descriptors are a Java 9+ feature, this would require at least a build-time requirement of a post-Java 8 JDK.
I'm happy to contribute a full module descriptor, but it'd be good to know if you have any plans regarding raising the Java requirement for TerminalConsoleAppender. If you decide to require Java 11 at runtime, that will simplify the build process. If not, that's still fine, and TCA can maintain its Java 8 runtime compatibility while using a later JDK at build-time. (If you're wondering how building with a later JDK is safe for a Java 8 library, the --release flag is a rock-solid way to ensure compatibility and is a javac-inbuilt replacement for animal-sniffer)
For now, I've opened #22 to add an automatic module name. Here's an accurate and concise introduction to the module system focusing on library maintainers: http://branchandbound.net/blog/java/2017/12/automatic-module-name/
Thanks!
I'm happy to contribute a full module descriptor, but it'd be good to know if you have any plans regarding raising the Java requirement for TerminalConsoleAppender. If you decide to require Java 11 at runtime, that will simplify the build process. If not, that's still fine, and TCA can maintain its Java 8 runtime compatibility while using a later JDK at build-time.
Personally, I see no reason to bump the runtime requirement just for some module descriptors. Unless there is some really, really cool feature in newer Java versions that TCA itself can make use of, I would try to keep the Java version requirement close to the dependencies TCA is designed to work with - Log4j2 (Java 7, wow) and JLine (Java 8).
Again lack of larger understanding of the module system, but I'm not sure if a full module descriptor makes sense for TCA, given that it's main dependencies (log4j-core and jline3) also only provide automatic module names.
Module descriptors aren't an absolute necessary, it's true. I do suggest you add them, however. Log4j has added a full module descriptor for the API and plans to modularize Log4j-Core. A growing number of major libraries including Gson, Jackson, JUnit, ByteBuddy, HikariCP, HSQLDB, Caffeine, and Lombok also have full descriptors - only two of which I mentioned require Java 9+ at runtime. Several others have plans or a descriptor awaiting release.
Log4j was apparently waiting on one of its dependencies: LMAX-Exchange/disruptor#369
Log4j has added a full module descriptor for the API and plans to modularize Log4j-Core.
Sure, just saying it doesn't really make sense when we don't know how Log4j-Core is going to be modularized. That will certainly require adjustments later if it's going to happen, right?
Sure, just saying it doesn't really make sense when we don't know how Log4j-Core is going to be modularized. That will certainly require adjustments later if it's going to happen, right?
No, Log4j's modularization will not affect how TCA's module would look like. A pre-requisite for modularization is for dependencies to declare at least an Automatic-Module-Name, not necessarily that dependencies are fully modularized themselves.
OK then, I guess we can add a proper module-info then. Again, contributions welcome since I clearly have no idea how this stuff works :)