Skip to content

Set Automatic-Module-Name to 'beagle' in published JAR#241

Open
alexeid wants to merge 1 commit into
beagle-dev:masterfrom
alexeid:add-automatic-module-name
Open

Set Automatic-Module-Name to 'beagle' in published JAR#241
alexeid wants to merge 1 commit into
beagle-dev:masterfrom
alexeid:add-automatic-module-name

Conversation

@alexeid
Copy link
Copy Markdown

@alexeid alexeid commented May 14, 2026

Summary

Adds Automatic-Module-Name: beagle to the JAR manifest produced by the Maven build.

Without this, the published beagle-1.0.0.jar is 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 downstream requires beagle; clause). Recent Maven versions give this warning:

[WARNING] Required filename-based automodules detected: [beagle-1.0.0.jar]. Please don't publish this project to a public artifact repository!

Downstream projects in the BEAST ecosystem (feast, remaster, bdmm-prime, beast3, …) hit this warning and are concerned about publishing because of it.

Why beagle as the module name

JPMS already derives beagle from the filename today, so any consumer with requires beagle; is implicitly relying on that name. Locking it in as the explicit Automatic-Module-Name makes the name stable without breaking any existing downstream module-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 package succeeds locally
  • unzip -p lib/beagle.jar META-INF/MANIFEST.MF | grep Automatic-Module-Name shows Automatic-Module-Name: beagle
  • Building a downstream project (e.g. feast) against the locally-installed JAR no longer emits the filename-based automodule warning

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant