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

[jira] [Comment Edited] (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=17498468#comment-17498468 ] 

Daniel Norberg edited comment on MCOMPILER-486 at 2/26/22, 4:46 PM:
--------------------------------------------------------------------

Yeah, that's my conclusion as well, having read through {{BasicComponentConfigurator}} etc in {{{}org.codehaus.plexus.component.configurator{}}}. But I'm having a hard time understanding whether this is intended and desirable behavior. Is there any way that a maven plugin can inject a validator or custom configurator to validate the plugin configuration?


was (Author: danielnorberg):
Yeah, that's my conclusion as well, having read through {{BasicComponentConfigurator}} etc in {{{}org.codehaus.plexus.component.configurator{}}}. But I'm having a hard time buying that this is intended and desirable behavior. Is there any way that a maven plugin can inject a validator or custom configurator to validate the plugin configuration?

> 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)