Skip to content

Refactoring and support of <release> and <module> elements #320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

desruisseaux
Copy link
Contributor

This is a refactoring of the compiler plugin which separates the MOJO, which contains the configuration, from the code that configures and executes the javax.tools.JavaCompiler. This refactoring splits one big class in two smaller classes for the compilation of main, and similarly for the compilation of test. This refactoring facilitates the development described in the next paragraph.

This pull request implements the support of the <include>, <exclude>, <release> and <module> elements of <source>. For now, the release and module elements can be used separately but not yet together.

This pull request also contains opportunistic bug fixes in the incremental compilation. There is one change visible to users compared to 4.0.0-beta-2: in the incrementalCompilation option, the additions enumeration value has been renamed rebuild-on-add for clarity and consistency with rebuild-on-change. These options did not existed in Maven 3.

…as testing another plugin than this project.

It was testing `pw.krejci:multi-release-jar-maven-plugin`, which fails with `NoSuchMethodError` with Maven 4-RC3.
That external project may need to be updated for Maven 4.
Update for changes in the `Project` interface.
The fix leverages the new `SourceRoot` element.
…of the `pom.xml` file.

With this commit, the include/exclude filters declared in `<source>` are combined with the
include/exclude filters declared in the puglin configuration. The module name and release
information are also stored, but only partially supported yet.
…d body in a separated class.

The intend is to reduce the complexity by splitting one big method into smaller methods.
It may also help external applications (e.g. IDE) to use `ToolExecutor` in their environment.
…ment.

Initial support of modular project (JPMS) by using the `<module>` element.
Currently support only one or the other, not yet both in same time.

Contains fixes for incremental build:
* The `package-info.java` source files may produce no output.
* Provide an option to rebuild everything as soon as one file changed.

The `additions` aspect has been renamed `rebuild-on-add` for clarity and
for consistency with `rebuild-on-change` added in the last above point.
…c link.

This hack is needed only when we want to simulate the Maven 3 behaviour for compatibility reasons.

This hack is fragile to the case where a module name is a single name (without dot)
and that name is the same as the package name. This ambiguity breaks two tests.
For allowing the tests to pass, this commit renames "foo" module as "foo.bar".
- Multi-release project defined with the new `<source>` element.
- Modular project defined with the new `<source>` element.
@desruisseaux
Copy link
Contributor Author

Hello @gnodet. I'm not sure how to proceed with this pull request, because it is massive and would require a lot of work for reviewers. This PR is hard to split in smaller pull requests focussing on different features. The best I could do is to try to organize the commits.

@desruisseaux
Copy link
Contributor Author

Includes a fix for #326.

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.

2 participants