packageurl-java icon indicating copy to clipboard operation
packageurl-java copied to clipboard

Could use a module name

Open ghost314 opened this issue 2 years ago • 0 comments

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.

eclipse warning

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.

Maven warning

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.

Module name example

This post has a lot more info on the matter.

ghost314 avatar Apr 24 '23 05:04 ghost314