You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Delany (Jira)" <ji...@apache.org> on 2022/12/09 08:07:00 UTC

[jira] [Commented] (MCOMPILER-514) Cant stack compiler plugin argument variations

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

Delany commented on MCOMPILER-514:
----------------------------------

Ok here's my workaround
{code:java}
<properties>
  <build.ep>-Xep:SuppressWarningsWithoutExplanation:WARN</build.ep>
</properties>
...
<compilerArgs combine.children="append">
  <arg>-Xlint:all,-processing</arg>
  <arg>-XDcompilePolicy=byfile</arg>
  <arg>-Xplugin:ErrorProne -XepDisableAllChecks ${build.ep}</arg>
</compilerArgs>
...
<profile>
  <id>EPE</id>
  <activation>
    <property>
      <name>EPE</name>
    </property>
  </activation>
  <properties>
    <build.ep>-Xep:${EPE}:ERROR</build.ep>
  </properties>
</profile>
<profile>
  <id>EPW</id>
  <activation>
    <property>
      <name>EPW</name>
    </property>
  </activation>
  <properties>
    <build.ep>-Xep:${EPW}:WARN</build.ep>
  </properties>
</profile>
<profile>
  <id>EPP</id>
  <activation>
    <property>
      <name>EPP</name>
    </property>
  </activation>
  <properties>
    <build.ep>-XepPatchLocation:IN_PLACE -XepPatchChecks:${EPP}</build.ep>
  </properties>
</profile>{code}
Then if I want the build to fail with DefaultCharset violations
{code:java}
./mvnw -DEPE=DefaultCharset {code}

> Cant stack compiler plugin argument variations
> ----------------------------------------------
>
>                 Key: MCOMPILER-514
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-514
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.10.1
>            Reporter: Delany
>            Priority: Major
>
> This works
> {code:java}
> <compilerArgs>
>   <arg>-Xlint:all,-processing</arg>
>   <arg>-Xlint:all</arg>
>   <arg>-XDcompilePolicy=byfile</arg>
>   <arg>-Xplugin:ErrorProne</arg>
>   <arg>-Xplugin:ErrorProne</arg>
> </compilerArgs>{code}
> But this
> {code:java}
> <compilerArgs>
>   <arg>-Xlint:all,-processing</arg>
>   <arg>-Xlint:all</arg>
>   <arg>-XDcompilePolicy=byfile</arg>
>   <arg>-Xplugin:ErrorProne</arg>
>   <arg>-Xplugin:ErrorProne -XepDisableAllChecks</arg>
> </compilerArgs>{code}
> fails with this
> {noformat}
> [ERROR] org.apache.maven.cli.MavenCli - plug-in not found: ErrorProne{noformat}
> There is no problem stacking -Xlint argument variations, or stacking the -Xplugin argument (provided the argument is the same.) But it dies when the -Xplugin argument varies. Why should this be?
> Use case? I have separate profiles for activating various errorprone bugpatterns. I want a default configuration in place unless I activate one of these profiles. I dont want to have to edit source code every time to check a different bugpattern.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)