Set Automatic-Module-Name to 'beagle' in published JAR#241
Open
alexeid wants to merge 1 commit into
Open
Conversation
Adds a stable JPMS module name via MANIFEST.MF so the artifact is no longer treated as a filename-based automodule. This silences the 'Required filename-based automodules detected' warning that downstream consumers see when building against beagle, and unblocks publishing those downstream artifacts to Maven Central (which discourages filename-derived module names because they change if the JAR is renamed). The chosen name matches the existing Java package (beagle.*) and the name JPMS was already deriving from the filename, so existing downstream 'requires beagle;' declarations continue to work unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
Automatic-Module-Name: beagleto the JAR manifest produced by the Maven build.Without this, the published
beagle-1.0.0.jaris treated by JPMS as a filename-based automodule: the module name is derived from the JAR filename, which is unstable (renaming the jar silently breaks every downstreamrequires beagle;clause). Recent Maven versions give this warning:Downstream projects in the BEAST ecosystem (feast, remaster, bdmm-prime, beast3, …) hit this warning and are concerned about publishing because of it.
Why
beagleas the module nameJPMS already derives
beaglefrom the filename today, so any consumer withrequires beagle;is implicitly relying on that name. Locking it in as the explicitAutomatic-Module-Namemakes the name stable without breaking any existing downstreammodule-info.java. The name also matches the existing Java package (beagle.*).A reverse-DNS form (e.g.
io.github.beagledev.beagle) is the JPMS-purist choice, but would require every downstream consumer to update their module declarations, so the short name is simpler.Test plan
mvn clean packagesucceeds locallyunzip -p lib/beagle.jar META-INF/MANIFEST.MF | grep Automatic-Module-NameshowsAutomatic-Module-Name: beagle