Replies: 5 comments 20 replies
-
I have the same issue. |
Beta Was this translation helpful? Give feedback.
-
Hi @ratoaq2, Thanks for the detailed error log — it's very helpful. From what you've shared, the issue is occurring during the
If you want to use a separate execution for annotation processing, you need to disable annotation processing in <execution>
<id>default-compile</id>
<configuration>
<proc>none</proc>
</configuration>
</execution> If, on the other hand, you want to perform both compilation and annotation processing (Log4j plugin descriptor + GraalVM metadata) in a single Maven execution, you can fully configure the <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.15.0</version>
</dependency>
</dependencies>
<configuration>
<!-- Use Eclipse Compiler explicitly -->
<compilerId>eclipse</compilerId>
<release>21</release>
<!-- Default to no annotation processing unless explicitly enabled -->
<proc>none</proc>
</configuration>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.25.0</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<annotationProcessor>
org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
</annotationProcessor>
<annotationProcessor>
org.apache.logging.log4j.core.config.plugins.processor.GraalVmProcessor
</annotationProcessor>
</annotationProcessors>
<compilerArgs>
<!-- Required arguments for GraalVmProcessor -->
<arg>-Alog4j.graalvm.groupId=${project.groupId}</arg>
<arg>-Alog4j.graalvm.artifactId=${project.artifactId}</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin> I hope that helps solving your problem. |
Beta Was this translation helpful? Give feedback.
-
It seems I got it working with proc none plus empty annotation processors: <annotationProcessorPaths>
<path>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<!-- empty -->
</annotationProcessors> |
Beta Was this translation helpful? Give feedback.
-
Tried to making work with |
Beta Was this translation helpful? Give feedback.
-
To keep deprecated code out of our codebase, we enable deprecation warnings and treat compilation warnings as errors, in order to break the build and call attention to the deprecated code usage. <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<compilerArgs>
<!-- Treat Warnings as Errors -->
<arg>-Werror</arg>
<!-- Enable deprecation warnings -->
<arg>-Xlint:deprecation</arg>
</compilerArgs>
<showWarnings>true</showWarnings>
<!-- https://issues.apache.org/jira/browse/MCOMPILER-209 -->
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin> We do not use Graal. I tried upgrading from 2.24.3 to 2.25.1 but the build fails with: ...
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ kfs-core ---
[INFO] Compiling 954 source files with javac [debug release 21] to target/test-classes
[INFO] Annotation processing is enabled because one or more processors were found
on the class path. A future release of javac may disable annotation processing
unless at least one processor is specified by name (-processor), or a search
path is specified (--processor-path, --processor-module-path), or annotation
processing is enabled explicitly (-proc:only, -proc:full).
Use -Xlint:-options to suppress this message.
Use -proc:none to disable annotation processing.
[INFO] GraalVmProcessor: writing GraalVM metadata for 2 Java classes to `META-INF/native-image/log4j-generated/cb86055/reflect-config.json`.
[INFO] PluginProcessor: writing plugin descriptor for 4 Log4j Plugins to `META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat`.
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] The `GraalVmProcessor` annotation processor is missing the recommended `log4j.graalvm.groupId` and `log4j.graalvm.artifactId` options.
To follow the GraalVM recommendations, please add the following options to your build tool:
-Alog4j.graalvm.groupId=<groupId>
-Alog4j.graalvm.artifactId=<artifactId>
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] warnings found and -Werror specified
[INFO] 1 error
... Due to our steps to keep deprecated code out of the codebase, this warning, for something we do not use and do not care about, is breaking the build. It doesn't make sense to have to provide useless configuration in N different builds to make this go away. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I have a java 21 maven project which uses eclipse compiler org.codehaus.plexus:plexus-compiler-eclipse:2.15.0 and has a log4j plugin using a Log4j2Plugins.dat file and configured the compiler with:
After upgrading from 2.24.3 to 2.25.0 now my compilation is failing with:
Is anyone facing similar issue? I tried to specify the graal processor with its arguments, but that doesn't work either.
Beta Was this translation helpful? Give feedback.
All reactions