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


##########
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>
+                <path>
+                  <groupId>org.apache.logging.log4j</groupId>
+                  <artifactId>log4j-core</artifactId>
+                  <version>${version.log4j}</version>
+                </path>
+              </annotationProcessorPaths>
+              <annotationProcessors>

Review Comment:
   It's correct that it avoids auto discovery, but it's incorrect that it's 
avoiding the errorprone processor. It's actually avoiding a second log4j 
process (GraalVMProcessor) from log4j-core, which is what the other comments 
explain.
   
   The errorprone one is being avoided by not being present on the 
`<annotationProcessorPaths/>` element in this profile, since it's only added to 
that in the other profile. A comment here to explain that part would just be 
explaining how Maven profiles and/or `maven-compiler-plugin` configuration 
elements work, which I think is best left to the docs for those projects.



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