[ https://issues.apache.org/jira/browse/MCOMPILER-479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Halil İbrahim Şener updated MCOMPILER-479: ------------------------------------------ Description: The Javadoc for {{compilerArgs}} states {quote} Sets the arguments to be passed to the compiler if {{fork}} is set to {{true}}. {quote} However, by looking at the [code|https://github.com/apache/maven-compiler-plugin/blob/5463357ebc1c65a4e25bfd8ea4c453a618b66bf1/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java#L950-L956], it seems the arguments are passed unconditionally (whether {{fork}} is enabled or not). Our understanding is that the JVM flags (e.g., {{-J-Duser.language=en_us}}) are only applicable when {{fork}} is enabled. However, compiler arguments (e.g. {{-Xlint:all}}) are always passed through. As [~cushon] suggests [here|https://github.com/google/error-prone/issues/2786#issuecomment-1004010889], maybe we should improve the doc, and/or report a warning/error. {quote} Perhaps that could be at least clarified in the docs, or maven could report an error if -J is set without fork enabled, or something. {quote} See also the discussion in [google/error-prone#2786|https://github.com/google/error-prone/issues/2786]. was: The Javadoc for {{compilerArgs}} states {quote} Sets the arguments to be passed to the compiler if {{fork}} is set to {{true}}. {quote} However, by looking at the [code|https://github.com/apache/maven-compiler-plugin/blob/5463357ebc1c65a4e25bfd8ea4c453a618b66bf1/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java#L950-L956], it seems the arguments are passed unconditionally (whether {{fork}} is enabled or not). Our understanding is that the JVM flags (e.g., {{-J-Duser.language=en_us}}) are only applicable when {{fork}} is enabled. However, compiler arguments (e.g. {{-Xlint:all}}) are always passed through. As [~cushon] suggests [here|https://github.com/google/error-prone/issues/2786#issuecomment-1004010889], maybe we should improve the doc, and/or report a warning/error. {quote} Perhaps that could be at least clarified in the docs, or maven could report an error if -J is set without fork enabled, or something. {quote} See also the discussion in [google/error-prone#2786](https://github.com/google/error-prone/issues/2786). > Clarify `compilerArgs` Javadoc > ------------------------------ > > Key: MCOMPILER-479 > URL: https://issues.apache.org/jira/browse/MCOMPILER-479 > Project: Maven Compiler Plugin > Issue Type: Improvement > Affects Versions: 3.8.1 > Reporter: Halil İbrahim Şener > Priority: Minor > > The Javadoc for {{compilerArgs}} states > {quote} > Sets the arguments to be passed to the compiler if {{fork}} is set to > {{true}}. > {quote} > However, by looking at the > [code|https://github.com/apache/maven-compiler-plugin/blob/5463357ebc1c65a4e25bfd8ea4c453a618b66bf1/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java#L950-L956], > it seems the arguments are passed unconditionally (whether {{fork}} is > enabled or not). > Our understanding is that the JVM flags (e.g., {{-J-Duser.language=en_us}}) > are only applicable when {{fork}} is enabled. However, compiler arguments > (e.g. {{-Xlint:all}}) are always passed through. > As [~cushon] suggests > [here|https://github.com/google/error-prone/issues/2786#issuecomment-1004010889], > maybe we should improve the doc, and/or report a warning/error. > {quote} > Perhaps that could be at least clarified in the docs, or maven could report > an error if -J is set without fork enabled, or something. > {quote} > See also the discussion in > [google/error-prone#2786|https://github.com/google/error-prone/issues/2786]. -- This message was sent by Atlassian Jira (v8.20.1#820001)