You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stefan Röck (Jira)" <ji...@apache.org> on 2022/11/09 20:28:00 UTC

[jira] [Updated] (MCOMPILER-511) proc:only doesn't work as expected

     [ https://issues.apache.org/jira/browse/MCOMPILER-511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Röck updated MCOMPILER-511:
----------------------------------
    Description: 
According to the docs [https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#proc,] *proc:only* should only process annotation processors but *not* trigger compilation. However, files are always compiled with the following config:

{code}
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <annotationProcessors>
                                <processor>org.immutables.processor.ProxyProcessor</processor>
                            </annotationProcessors>
                            <proc>only</proc>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
{code}


See small reproducer repo at https://github.com/stefanroeck/annotationtest

In the logs I can see that the prop is passed through, but still 2 classes are compiled:

{code}
21:12:25,407 [DEBUG] -d C:\dev\IdeaProjects\annotationtest\target\classes -classpath C:\dev\IdeaProjects\annotationtest\target\classes;C:\Dev\.m2\repository\org\immutables\value\2.8.8\value-2.8.8.jar; -sourcepath C:\dev\IdeaProjects\annotationtest\src\main\java;C:\dev\IdeaProjects\annotationtest\target\generated-sources\annotations; -s C:\dev\IdeaProjects\annotationtest\target\generated-sources\annotations -proc:only -processor org.immutables.processor.ProxyProcessor -g -nowarn -target 17 -source 17 -encoding UTF-8
21:12:25,412 [DEBUG] incrementalBuildHelper#beforeRebuildExecution
21:12:25,412 [INFO] Compiling 2 source files to C:\dev\IdeaProjects\annotationtest\target\classes

{code}

  was:
According to the docs [https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#proc,] *proc:only* should only process annotation processors but *not* trigger compilation. However, files are always compiled with the following config:

{code}
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <annotationProcessors>
                                <processor>org.immutables.processor.ProxyProcessor</processor>
                            </annotationProcessors>
                            <proc>only</proc>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
{code}


See small reproducer repo at https://github.com/stefanroeck/annotationtest


> proc:only doesn't work as expected
> ----------------------------------
>
>                 Key: MCOMPILER-511
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-511
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.10.1
>         Environment: Windows, Tested with JDK 1.8, 11, 17
>            Reporter: Stefan Röck
>            Priority: Major
>
> According to the docs [https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#proc,] *proc:only* should only process annotation processors but *not* trigger compilation. However, files are always compiled with the following config:
> {code}
> <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-compiler-plugin</artifactId>
>                 <version>3.10.1</version>
>                 <executions>
>                     <execution>
>                         <id>process</id>
>                         <phase>generate-sources</phase>
>                         <goals>
>                             <goal>compile</goal>
>                         </goals>
>                         <configuration>
>                             <annotationProcessors>
>                                 <processor>org.immutables.processor.ProxyProcessor</processor>
>                             </annotationProcessors>
>                             <proc>only</proc>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
> {code}
> See small reproducer repo at https://github.com/stefanroeck/annotationtest
> In the logs I can see that the prop is passed through, but still 2 classes are compiled:
> {code}
> 21:12:25,407 [DEBUG] -d C:\dev\IdeaProjects\annotationtest\target\classes -classpath C:\dev\IdeaProjects\annotationtest\target\classes;C:\Dev\.m2\repository\org\immutables\value\2.8.8\value-2.8.8.jar; -sourcepath C:\dev\IdeaProjects\annotationtest\src\main\java;C:\dev\IdeaProjects\annotationtest\target\generated-sources\annotations; -s C:\dev\IdeaProjects\annotationtest\target\generated-sources\annotations -proc:only -processor org.immutables.processor.ProxyProcessor -g -nowarn -target 17 -source 17 -encoding UTF-8
> 21:12:25,412 [DEBUG] incrementalBuildHelper#beforeRebuildExecution
> 21:12:25,412 [INFO] Compiling 2 source files to C:\dev\IdeaProjects\annotationtest\target\classes
> {code}



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