flogger icon indicating copy to clipboard operation
flogger copied to clipboard

Add 'Automatic-Module-Name' to MANIFEST.MF to support Java 9+ modules

Open cslee00 opened this issue 7 years ago • 4 comments

As with Guava, provide an automatic module name to avoid using the JAR name ('flogger') as the module name.

Guava: Automatic-Module-Name: com.google.common

Proposed for flogger: Automatic-Module-Name: com.google.common.flogger

cslee00 avatar Dec 30 '18 04:12 cslee00

Relevant context around use of Automatic-Module-Name: http://branchandbound.net/blog/java/2017/12/automatic-module-name/ https://blog.joda.org/2017/05/java-se-9-jpms-automatic-modules.html

cslee00 avatar Dec 30 '18 13:12 cslee00

Thanks, I'll have a look. However I don't make any promises, especially since I think Flogger might need so refactoring (a big task) before it adheres to the rules about modules (we don't have "closed" packages in the project and different artifacts own code in the same package). We might have to end up building a single combined JAR with fronted and backend code for use with modules (it's all do do with the fact that the core code is Java6 compatible while the JDK backend code is Java7+).

hagbard avatar Feb 28 '19 12:02 hagbard

Thanks. To be clear, this isn't about modularizing the code - rather reserving the module name to avoid downstream challenges when Flogger is modularized.

Currently, without the Automatic-Module-Name manifest entry, when Flogger is used in a modularized application the JVM will automagically determine the module name from the JAR filename (ugh). This will cause downstream problems for consumers of Flogger, particularly transitive dependencies on Flogger, when it's released as a proper module due to the module name changing. Adding Automatic-Module-Name reserves the module name now for future compatibility.

cslee00 avatar Feb 28 '19 14:02 cslee00

For reference: #22 highlights the JPMS issues

ronshapiro avatar Mar 31 '19 12:03 ronshapiro