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

[jira] [Commented] (MCOMPILER-486) annotationProcessors and annotationProcessorPaths accept incorrect child tags

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

Piotr Zygielo commented on MCOMPILER-486:
-----------------------------------------

I think it's all according to [https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Mapping_Collections.]

> annotationProcessors and annotationProcessorPaths accept incorrect child tags
> -----------------------------------------------------------------------------
>
>                 Key: MCOMPILER-486
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-486
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>            Reporter: Daniel Norberg
>            Priority: Major
>
> The compiler plugin seems to accept arbitrary tag names under {{annotationProcessors}} and {{annotationProcessorPaths}}. This causes users to produce incorrect pom.xml files that work in maven but fail in stricter tools that require child tag names to be {{annotationProcessor}} and {{path}}, respectively.
> See e.g. this incorrect configuration where {{annotationProcessor}} and {{path}} tag names have been replaced with {{arbitraryTag1}} and {{arbitraryTag2}} respectively:
> {code:xml}
> <plugin>
>   <artifactId>maven-compiler-plugin</artifactId>
>   <configuration>
>     <annotationProcessors>
>       <arbitraryTag1>org.issue.SimpleAnnotationProcessor</arbitraryTag1>
>     </annotationProcessors>
>     <annotationProcessorPaths>
>       <arbitraryTag2>
>         <groupId>org.issue</groupId>
>         <artifactId>annotation-processor</artifactId>
>         <version>1.0-SNAPSHOT</version>
>       </arbitraryTag2>
>     </annotationProcessorPaths>
>   </configuration>
> </plugin>
> {code}
> The above configuration is accepted same as the below correct configuration:
> {code:xml}
> <plugin>
>   <artifactId>maven-compiler-plugin</artifactId>
>   <configuration>
>     <annotationProcessors>
>       <annotationProcessor>org.issue.SimpleAnnotationProcessor</annotationProcessor>
>     </annotationProcessors>
>     <annotationProcessorPaths>
>       <path>
>         <groupId>org.issue</groupId>
>         <artifactId>annotation-processor</artifactId>
>         <version>1.0-SNAPSHOT</version>
>       </path>
>     </annotationProcessorPaths>
>   </configuration>
> </plugin>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)