maven-compiler-plugin icon indicating copy to clipboard operation
maven-compiler-plugin copied to clipboard

[MCOMPILER-543] Allow to exclude particular dependency from annotation processor classpath

Open jira-importer opened this issue 2 years ago • 0 comments

Alexey Markevich opened MCOMPILER-543 and commented

like Surefire but for annotationProcessorPaths element. Case is:

  • parent module:
   <build>
      <pluginManagement>
            <plugins>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                  <annotationProcessorPaths>
                     <path>
                        <groupId>grpoup1</groupId>
                        <artifactId>artifact1</artifactId>
                        <version>version1</version>
                     </path>
                  </annotationProcessorPaths>
               </configuration>
            </plugin>
...
      <profile>
          <build>
              <pluginManagement>
                 <plugins>
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-compiler-plugin</artifactId>
                         <configuration>
                             <annotationProcessorPaths combine.children="append">
                                 <path>
                                     <groupId>group2</groupId>
                                     <artifactId>artifact2</artifactId>
                                     <version>version2</version>
                                 </path>
                             </annotationProcessorPaths>
                         </configuration>

 - child module:

<build>
   <plugins>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <executions>
            <execution>
               <id>default-compile</id>
               <phase>compile</phase>
               <goals>
                  <goal>compile</goal>
               </goals>
               <configuration>
                  <annotationProcessorPaths combine.self="override"/>
               </configuration>

disable all processors. Goal is exclude only base one to have something like

<build>
   <plugins>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <executions>
            <execution>
               <id>default-compile</id>
               <phase>compile</phase>
               <goals>
                  <goal>compile</goal>
               </goals>
               <configuration>
                  <annotationProcessorPathsExcludes>
                        <annotationProcessorPathsExclude>group1:artifact1:version1</annotationProcessorPathsExcludeude>

No further details from MCOMPILER-543

jira-importer avatar Aug 19 '23 21:08 jira-importer