You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MCOMPILER-581] Create second default execution "default-generate-sources" for APT #857
Starting with version 4.0.0 of this plugin for use with Maven 4+, the following changes should be incorporated to align the compilation process with the process designed by the OpenJDK javac team:
Modify default-compile to use proc:none by default
Create a new goal default-generate-sources and use proc:only
This will align the compilation process with the default javac use.
Rationale
Before JDK 21+, no "proc:full" was available and implicitly used when no proc:* was set.
However, starting with JDK 21, proc:full was introduced and not specifying proc:* will now trigger a warning.
Alternatives
Keep one phase but specify proc:full whenever APTs are in the CP or used as a compiler-plugin dependency/path or when APT classes are explicitly given.
Drawbacks of this approach
TODO: document drawbacks of this approach and of the alternatives.
create 2 new mojos "proc" and "test-proc" (or apt or whatever) that automatically binds to "generate-sources" and "generate-test-sources" phases: they use proc:only
add new configuration to AbstractCompilerMojo like "two phase APT" (boolean) defaults to false, keep today functionality, works as now
behavior change 1: if "two phase APT" is false, the two new mojos just skip (like skip would be set), they immediately exit doing nothing and existing compile and test-compile mojos do whatever they did before.
behavior change 2: "if two phase APT" is true, existing compiler mojo use proc:none (maybe fail if proc explicitly configured?), and the two new mojos activate and run using {}proc:only{}.
Am unsure why we need Maven4 for change like this.
Activity
jira-importer commentedon Mar 7, 2024
Tamas Cservenak commented
How about something along these lines:
proc:onlyAbstractCompilerMojolike "two phase APT" (boolean) defaults to false, keep today functionality, works as nowproc:none(maybe fail if proc explicitly configured?), and the two new mojos activate and run using{}proc:only{}.Am unsure why we need Maven4 for change like this.