Hello all
Recently, we had some issues reported against the Maven Compiler Plugin
3.14 which can be avoided by using Maven 4 with the Compiler Plugin 4:
* https://github.com/apache/maven-compiler-plugin/issues/961
* https://github.com/apache/maven-compiler-plugin/issues/962
Users who tested the Compiler Plugin 4.0.0-beta-2 reported that it
works, but that plugin requires Maven 4.0.0-rc-2 and is incompatible
with Maven 4.0.0-rc-4. That incompatibility is already fixed in Compiler
Plugin 4.0.0-beta-3, together with other bug fixes and improvements.
Would it be time to make a new Compiler Plugin release?
If we do a release, there are two pull requests that I would like to
include. The first one allows to compile a project which is both
multi-modules (in JPMS sense) and multi-releases. Without this pull
request, a project can be either multi-modules or multi-releases, but
not both in same time. However, this pull request includes a directory
layout choice that may be subject to debate. An explanation is in the
pull request. But I would like to emphase that this is a concern only
for developers using the JPMS module source hierarchy. For peoples not
interested in JPMS, nothing change. Note also that even for developers
not interested in JPMS, this pull request contains bug fixes in the
support of plain multi-releases projects:
https://github.com/apache/maven-compiler-plugin/pull/959
The second pull request may be more controversial. A problem is that
compiling the tests of a JPMS project is difficult. Declaring the
`--add-reads` and similar options in the plugin configuration in the POM
is very tedious. Many developers prefer to write a `module-info.java`
file in the test which overwrite the `module-info.java` file of their
main code, but this approach also has problems. The following pull
request proposes a `module-info-patch.maven` file intended to make the
compilation of tests of JPMS projects both clean and easy:
https://github.com/apache/maven-compiler-plugin/pull/963
It has been argued in previous threads on this mailing list that those
options should be set by plugin configuration instead. But this
capability already exists in Maven 3, and is so tedious that is is
rarely done as far as I know. However, as an attempt to find a
compromise, I propose to flag this feature as experimental. The idea is
that if we want to compare the pros and cons of different approaches, it
is better of peoples have a chance to try them.
Martin