[
https://issues.apache.org/jira/browse/MCOMPILER-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17778798#comment-17778798
]
ASF GitHub Bot commented on MCOMPILER-548:
------------------------------------------
hgschmie commented on code in PR #200:
URL:
https://github.com/apache/maven-compiler-plugin/pull/200#discussion_r1369182520
##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -279,8 +279,11 @@ public abstract class AbstractCompilerMojo extends
AbstractMojo {
* <ul>
* <li><code>none</code> - no annotation processing is performed.</li>
* <li><code>only</code> - only annotation processing is done, no
compilation.</li>
+ * <li><code>full</code> - annotation processing and compilation.</li>
* </ul>
*
+ * <code>full</code> is the default. Starting with JDK 21, this option
must be set explicitly.
Review Comment:
if you don't set it on JDK 21, you will be greeted with a warning that
"soon, not setting proc:full will result in no longer doing annotation
processing".
It is a very unsatisfying situation:
JDK < 21: proc:full is not allowed, results in `error: invalid flag:
-proc:full`
JDK == 21: proc:full works, a warning is reported without it
JDK > 21: proc:full is *required* at some point, no more annotation
processing without it
which puts the compiler plugin in the unfortunate situation of having to
check the version of javac first before either not passing in `-proc:full`
(because it is JDK < 21 and it is set by default) or passing it in for JDK >=
21.
That's why the comment reads "requires more thought". I have not found time
to deal with it. Right now, I have a conditional profile in my poms... 😵💫
##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -279,8 +279,11 @@ public abstract class AbstractCompilerMojo extends
AbstractMojo {
* <ul>
* <li><code>none</code> - no annotation processing is performed.</li>
* <li><code>only</code> - only annotation processing is done, no
compilation.</li>
+ * <li><code>full</code> - annotation processing and compilation.</li>
* </ul>
*
+ * <code>full</code> is the default. Starting with JDK 21, this option
must be set explicitly.
Review Comment:
if you don't set it on JDK 21, you will be greeted with a warning that
"soon, not setting proc:full will result in no longer doing annotation
processing".
It is a very unsatisfying situation:
JDK < 21: proc:full is not allowed, results in `error: invalid flag:
-proc:full`
JDK == 21: proc:full works, a warning is reported without it
JDK > 21: proc:full is *required* at some point, no more annotation
processing without it
which puts the compiler plugin in the unfortunate situation of having to
check the version of javac first before either not passing in `-proc:full`
(because it is JDK < 21 and it is set by default) or passing it in for JDK >=
21.
That's why the comment reads "requires more thought". I have not found time
to deal with it. Right now, I have a conditional profile in my poms... 😵💫
> JDK 21 throws annotations processing warning that can not be turned off
> -----------------------------------------------------------------------
>
> Key: MCOMPILER-548
> URL: https://issues.apache.org/jira/browse/MCOMPILER-548
> Project: Maven Compiler Plugin
> Issue Type: Bug
> Affects Versions: 3.11.0
> Reporter: Henning Schmiedehausen
> Priority: Major
>
> maven compiler plugin 3.11 on Java 21 reports
> {quote}
> [INFO] Annotation processing is enabled because one or more processors were
> found
> on the class path. A future release of javac may disable annotation
> processing
> unless at least one processor is specified by name (-processor), or a search
> path is specified (--processor-path, --processor-module-path), or annotation
> processing is enabled explicitly (-proc:only, -proc:full).
> Use -Xlint:-options to suppress this message.
> Use -proc:none to disable annotation processing.
> {quote}
> However, the {{<proc>}} option only supports "none" and "proc", not "full"
> (which is the implicit default).
> Adding this through a compiler option:
> {quote}
> <configuration>
> <compilerArgs>
> <arg>-proc:full</arg>
> </compilerArgs>
> </configuration>
> {quote}
> fixes this warning. Adding "full" as a value for the compiler plugin would
> fix it, too.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)