Nuance the message about filename-based automodules detected on the module path#11857
Open
desruisseaux wants to merge 1 commit intoapache:masterfrom
Open
Nuance the message about filename-based automodules detected on the module path#11857desruisseaux wants to merge 1 commit intoapache:masterfrom
desruisseaux wants to merge 1 commit intoapache:masterfrom
Conversation
…odule path. Instead of "Please don't publish this project to a public artifact repository", said "This project may not work in applications that do not use these dependencies with exactly the same filenames as listed above".
elharo
reviewed
Mar 29, 2026
| @@ -236,7 +236,7 @@ public JavaPathType getPathType() { | |||
| /** | |||
| * If the module has no name, adds the filename of the JAR file in the given collection. | |||
| * This method should be invoked for dependencies placed on {@link JavaPathType#MODULES} | |||
Contributor
There was a problem hiding this comment.
not new here, but this doc comment really is hard to follow or understand. It should be rewritten.
| fileSeparator, | ||
| "Filename-based automodules detected on the module path: " + fileSeparator, | ||
| lineSeparator + "This project may not work in applications that do not use " | ||
| + "these dependencies with exactly the same filenames as listed above."); |
Contributor
There was a problem hiding this comment.
Is this only an issue when JPMS is used?
Contributor
Author
There was a problem hiding this comment.
Yes, this is an issue if non-modular JARs are placed on the --module-path option. While not recommended, this is not forbidden neither in order to allow gradual transition, because the effect is not the same as keeping those JARs on --class-path. The javac tool already emits a warning for such cases, and developers may accept the risk if they understand the condition in which it works, which is to keep the JAR filenames 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.
Instead of "Please don't publish this project to a public artifact repository", said "This project may not work in applications that do not use these dependencies with exactly the same filenames as listed above".
Rational: it can be considered okay to publish the project on a public Maven repository, because the artifact filenames are quite deterministic with Maven. For a pure-Maven project and for bundle generated by the Maven assembly plugin, there is no reason why these filenames would not be stable. Therefore, we can warn the users about the fragility of filename-based automodules but let them decide whether they want to publish anyway.