ctubbsii commented on code in PR #5890:
URL: https://github.com/apache/accumulo/pull/5890#discussion_r2360901501


##########
pom.xml:
##########
@@ -1682,11 +1693,57 @@
         <surefire.reuseForks>${reuseForks}</surefire.reuseForks>
       </properties>
     </profile>
+    <profile>
+      <!--
+        Explicitly add the log4j annotation processor to generate the 
Log4jPlugins.dat file for the
+        AccumuloMonitorAppender, but only when not using the errorprone 
profile. This is necessary
+        because log4j added a GraalVMProcessor that we don't need and won't 
run without failing the
+        build, so we need to itemize all the processors we do want to run. 
Except, I couldn't get
+        errorprone to work when I tried to itemize its processors, so 
errorprone needs to rely on
+        the normal autodiscovery process. Since that would pick up the 
unwanted GraalVMProcessor,
+        this profile exists to avoid adding log4j-core to the processors when 
using errorprone.
+        This prevents using the AccumuloMonitorAppender when using the 
errorprone profile.
+        Activate the errorprone profile and de-activate this one 
simultaneously by using:
+        `mvn -Derrorprone` or `mvn -Perrorprone,!generate-log4j-plugin-data`
+      -->
+      <id>generate-log4j-plugin-data</id>
+      <activation>
+        <property>
+          <name>!errorprone</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <configuration>
+              <annotationProcessorPaths>

Review Comment:
   Before these changes, the `maven-compiler-plugin` config in the 
`<pluginManagement>` section did most of the work:
   
   1. `<pluginManagement>` config added `auto-service` and `log4j-core` to 
processor paths, relied on autodiscovery
   2. `errorprone` profile appended `error_prone_core` to the processor paths, 
still relied on autodiscovery
   
   After these changes,
   
   1. `<pluginManagement>` config only adds `auto-service` to the processor 
paths
   2. If `generate-log4j-plugin-data` profile is active, appends `log4j-core` 
to the processor paths, and enumerates the specific processors to run (because 
they are easily knowable, and I need to exclude one of the ones that would have 
been auto-discovered in `log4j-core` (does *not* use autodiscovery)
   3. If `errorprone` profile is active, appends `error_prone_core` to the 
processor paths, and relies on autodiscovery, just as before... but crucially, 
no `log4j-core` processors are run, because it should be considered 
mutually-exclusive with the `generate-log4j-plugin-data` profile that adds the 
one we need from there.
   
   Note:
   
   In the main branch, we drop `AccumuloMonitorAppender`, so we no longer need 
any of the `log4j-core` processors, and can exclude it from the processor paths 
entirely, so the config is much simpler, and we don't need this new profile in 
the main branch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to