You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Halil İbrahim Şener (Jira)" <ji...@apache.org> on 2022/01/04 10:53:00 UTC

[jira] [Created] (MCOMPILER-479) Clarify `compilerArgs` Javadoc

Halil İbrahim Şener created MCOMPILER-479:
---------------------------------------------

             Summary: 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


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)