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 15:43:00 UTC

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

Daniel Norberg created MCOMPILER-486:
----------------------------------------

             Summary: 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


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)