You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I decided to try building my latest project with the java module system so I can better understand how it works. I found myself needing to generate a package URL so I dropped in a reference to this project and a warning popped up.
Since no module name is declared in the jar manifest, it seems the module system defaults to using the jar file name as the module name. Apparently this can cause a major problem if the name changes (either because a proper name was picked, or because the name of the jar file changed) and 2 different modules try to reference it with different names. Maven even goes as far as to beg me not to publish my project until the issue is fixed.
Personally I wonder if it's really that big a deal when I could presumably just release a new version of my project referencing the new module name, but anyhow it's an easy fix. You basically just need to pick a module name and add it to the manifest, which can be done while still compiling and running on JDK 8. For instance here is the jar manifest for the apache commons codec project.
I decided to try building my latest project with the java module system so I can better understand how it works. I found myself needing to generate a package URL so I dropped in a reference to this project and a warning popped up.
Since no module name is declared in the jar manifest, it seems the module system defaults to using the jar file name as the module name. Apparently this can cause a major problem if the name changes (either because a proper name was picked, or because the name of the jar file changed) and 2 different modules try to reference it with different names. Maven even goes as far as to beg me not to publish my project until the issue is fixed.
Personally I wonder if it's really that big a deal when I could presumably just release a new version of my project referencing the new module name, but anyhow it's an easy fix. You basically just need to pick a module name and add it to the manifest, which can be done while still compiling and running on JDK 8. For instance here is the jar manifest for the apache commons codec project.
This post has a lot more info on the matter.
The text was updated successfully, but these errors were encountered: