desruisseaux opened a new pull request, #998:
URL: https://github.com/apache/maven-compiler-plugin/pull/998
When building a project which is both multi-module and multi-release as
described in #959, the output directory which is currently named
`META-INF/versions` should use another name, for example
`META-INF/versions-modular`. Therefore, the full pattern of the path to the
class files become `META-INF/versions-modular/${release}/${module}`.
**This change has no impact on classical Maven projects.** Projects that do
not use multi-module will continue to have their multi-release class files
written in the `META-INF/versions/` directory.
# Rational
The `${module}` subdirectory in above-cited path is inserted by `javac` when
module hierarchy is used. We have no control on that. However, there is no
multi-module JAR file format as of November 2025. Therefore, dispatching the
files for different modules in each JAR file would be the work of the Maven JAR
plugin. A prototype is almost ready
(https://github.com/apache/maven-jar-plugin/issues/495), but experience with
that prototype shows that it is difficult to guess whether the
`META-INF/versions/${release}` directory is expected to be followed by a
`${module}` subdirectory. Renaming `versions` to anything else would avoid that
ambiguity. We propose `versions-modular` as a short way to mean "versions for a
modular project". The directory name is not very important because this
directory will not appear in any JAR or any other file to be distributed. Only
its *content* is dispatched in JAR files.
**Note:** the need to modify the Maven JAR plugin for dispatching the
content of `META-INF/versions-modular` is not really a complication, because we
should do that anyway even with classical Maven projects. As said in
https://github.com/apache/maven-jar-plugin/issues/484, We should use the
`--release` option instead of just including blindly whatever is below the
`META-INF/versions` directory.
# Compatibility
Strictly speaking, this is a breaking change. However, since output of
multi-module & multi-release projects can be processed only by the Maven JAR
plugin prototype, we assume that there is no dependency to the current
directory name yet.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]