maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Boyles (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (MCOMPILER-425) Compiler argument with newline treated as multiple arguments in fork mode
Date Thu, 24 Sep 2020 12:43:01 GMT

    [ https://issues.apache.org/jira/browse/MCOMPILER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17201501#comment-17201501
] 

Michael Boyles edited comment on MCOMPILER-425 at 9/24/20, 12:42 PM:
---------------------------------------------------------------------

Shouldn't you be doing this? They're on different lines, which is what you wanted.
{code:java}
<compilerArgs>
    <arg>-XDcompilePolicy=simple</arg>
    <arg>-Xplugin:ErrorProne</arg>
    <arg>-Xep:ObjectToString:ERROR</arg>
</compilerArgs> {code}

 You say that it works when not forking, but these parameters are only used when forking. As
per [the docs|https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#compilerArgs] "Sets
the arguments to be passed to the compiler if {{fork}} is set to {{true"}}

So if you think that these params are being applied to non-forked version, you are mistaken.
(I doubled-checked with latest build to see whether the docs were accurate, by passing a spurious
compiler parameter, and it was indeed not applied)


was (Author: michaelboyles):
Shouldn't you be doing this? They're on different lines, which is what you wanted.
<compilerArgs><arg>-XDcompilePolicy=simple</arg><arg>-Xplugin:ErrorProne</arg>
   <arg>-Xep:ObjectToString:ERROR</arg></compilerArgs>
You say that it works when not forking, but these parameters are only used when forking. As
per [the docs|https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#compilerArgs] "Sets
the arguments to be passed to the compiler if {{fork}} is set to {{true"}}

So if you think that these params are being applied to non-forked version, you are mistaken.
(I doubled-checked with latest build to see whether the docs were accurate, by passing a spurious
compiler parameter, and it was indeed not applied)

> Compiler argument with newline treated as multiple arguments in fork mode
> -------------------------------------------------------------------------
>
>                 Key: MCOMPILER-425
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-425
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.8.1
>            Reporter: David Phillips
>            Priority: Major
>
> In the below example, we want to pass the second argument as a single argument to the
compiler, but we add newlines in the XML for readability. This works correctly when not forking,
but when forking, the argument is treated as multiple arguments.
> {code:xml}
> <configuration>
>   <fork>true</fork>
>   <compilerArgs>
>     <arg>-XDcompilePolicy=simple</arg>
>     <arg>
>       -Xplugin:ErrorProne
>       -Xep:ObjectToString:ERROR
>     </arg>
>   </compilerArgs>
>   <annotationProcessorPaths>
>     <path>
>       <groupId>com.google.errorprone</groupId>
>       <artifactId>error_prone_core</artifactId>
>       <version>2.4.0</version>
>     </path>
>   </annotationProcessorPaths>
> </configuration>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message