You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ro...@apache.org on 2024/06/28 15:49:32 UTC
(activemq-artemis) branch main updated: ARTEMIS-4872: use explicit annotationProcessorPaths compiler config
This is an automated email from the ASF dual-hosted git repository.
robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new d45349fa67 ARTEMIS-4872: use explicit annotationProcessorPaths compiler config
d45349fa67 is described below
commit d45349fa67a967691c8f78b8d46c3f460c278c81
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Thu Jun 27 17:26:17 2024 +0100
ARTEMIS-4872: use explicit annotationProcessorPaths compiler config
Updates artemis-log-annotation-processor to use artemis-project so that
artemis-pom can reference artemis-log-annotation-processor without cycle.
Split out its tests to their own module to faciltate, also exercising the
profile mechanism to enable the processor usage with trigger file.
Simplify disabling processing in the module using maven.compiler.proc prop
available since maven-compiler-plugin 3.13.0
Uses a dummy non-processor path at root to 'disable' processsing on JDK < 23,
accounting for Maven 3 not being able to unset maven.compiler.proc from a
parent, and JDKs < 21 requiring newest builds to support -proc:full value
needed otherwise to reenable processing once explicitly disabled.
---
.../enable-log-bundle-annotation-processor | 0
artemis-cli/enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
artemis-log-annotation-processor/pom.xml | 63 +++-------------------
.../tests/enable-log-bundle-annotation-processor | 0
.../{ => tests}/pom.xml | 41 ++++++--------
.../logs/annotation/processor/MyException.java | 0
.../logs/annotation/processor/MyObject.java | 0
.../logs/annotation/processor/SimpleBundle.java | 0
.../annotation/processor/SimpleBundleTest.java | 0
artemis-pom/pom.xml | 28 ++++++++++
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
artemis-ra/enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
artemis-web/enable-log-bundle-annotation-processor | 0
.../enable-log-bundle-annotation-processor | 0
pom.xml | 56 +++++++++++++------
29 files changed, 89 insertions(+), 99 deletions(-)
diff --git a/artemis-cdi-client/enable-log-bundle-annotation-processor b/artemis-cdi-client/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-cli/enable-log-bundle-annotation-processor b/artemis-cli/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-commons/enable-log-bundle-annotation-processor b/artemis-commons/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-core-client/enable-log-bundle-annotation-processor b/artemis-core-client/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-jakarta-client/enable-log-bundle-annotation-processor b/artemis-jakarta-client/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-jakarta-ra/enable-log-bundle-annotation-processor b/artemis-jakarta-ra/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-jakarta-server/enable-log-bundle-annotation-processor b/artemis-jakarta-server/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-jakarta-service-extensions/enable-log-bundle-annotation-processor b/artemis-jakarta-service-extensions/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-jms-client/enable-log-bundle-annotation-processor b/artemis-jms-client/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-jms-server/enable-log-bundle-annotation-processor b/artemis-jms-server/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-journal/enable-log-bundle-annotation-processor b/artemis-journal/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-log-annotation-processor/pom.xml b/artemis-log-annotation-processor/pom.xml
index 3376521896..6800824ea8 100644
--- a/artemis-log-annotation-processor/pom.xml
+++ b/artemis-log-annotation-processor/pom.xml
@@ -19,67 +19,18 @@
<parent>
<groupId>org.apache.activemq</groupId>
- <artifactId>artemis-pom</artifactId>
+ <artifactId>artemis-project</artifactId>
<version>2.36.0-SNAPSHOT</version>
- <relativePath>../artemis-pom/pom.xml</relativePath>
</parent>
<artifactId>artemis-log-annotation-processor</artifactId>
<packaging>jar</packaging>
- <name>ActiveMQ Log Annotation Processor</name>
+ <name>ActiveMQ Artemis Log Annotation Processor</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-unit-test-support</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>test</scope>
- <!-- License: MIT -->
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j2-impl</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- needed to compile the tests -->
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-api</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-engine</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <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>
- <!-- Disable annotation processing for ourselves. -->
- <compilerArgument>-proc:none</compilerArgument>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <properties>
+ <activemq.basedir>${project.basedir}/..</activemq.basedir>
+ <!-- Always disable annotation processing for ourselves. -->
+ <maven.compiler.proc>none</maven.compiler.proc>
+ </properties>
</project>
diff --git a/artemis-log-annotation-processor/tests/enable-log-bundle-annotation-processor b/artemis-log-annotation-processor/tests/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-log-annotation-processor/pom.xml b/artemis-log-annotation-processor/tests/pom.xml
similarity index 71%
copy from artemis-log-annotation-processor/pom.xml
copy to artemis-log-annotation-processor/tests/pom.xml
index 3376521896..7fcaf7c346 100644
--- a/artemis-log-annotation-processor/pom.xml
+++ b/artemis-log-annotation-processor/tests/pom.xml
@@ -21,14 +21,26 @@
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-pom</artifactId>
<version>2.36.0-SNAPSHOT</version>
- <relativePath>../artemis-pom/pom.xml</relativePath>
+ <relativePath>../../artemis-pom/pom.xml</relativePath>
</parent>
- <artifactId>artemis-log-annotation-processor</artifactId>
+ <artifactId>artemis-log-annotation-processor-tests</artifactId>
<packaging>jar</packaging>
- <name>ActiveMQ Log Annotation Processor</name>
+ <name>ActiveMQ Artemis Log Annotation Processor Tests</name>
+
+ <properties>
+ <activemq.basedir>${project.basedir}/../..</activemq.basedir>
+
+ <maven.deploy.skip>true</maven.deploy.skip>
+ </properties>
<dependencies>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-log-annotation-processor</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-unit-test-support</artifactId>
@@ -59,27 +71,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <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>
- <!-- Disable annotation processing for ourselves. -->
- <compilerArgument>-proc:none</compilerArgument>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
</project>
diff --git a/artemis-log-annotation-processor/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/MyException.java b/artemis-log-annotation-processor/tests/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/MyException.java
similarity index 100%
rename from artemis-log-annotation-processor/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/MyException.java
rename to artemis-log-annotation-processor/tests/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/MyException.java
diff --git a/artemis-log-annotation-processor/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/MyObject.java b/artemis-log-annotation-processor/tests/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/MyObject.java
similarity index 100%
rename from artemis-log-annotation-processor/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/MyObject.java
rename to artemis-log-annotation-processor/tests/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/MyObject.java
diff --git a/artemis-log-annotation-processor/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/SimpleBundle.java b/artemis-log-annotation-processor/tests/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/SimpleBundle.java
similarity index 100%
rename from artemis-log-annotation-processor/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/SimpleBundle.java
rename to artemis-log-annotation-processor/tests/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/SimpleBundle.java
diff --git a/artemis-log-annotation-processor/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/SimpleBundleTest.java b/artemis-log-annotation-processor/tests/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/SimpleBundleTest.java
similarity index 100%
rename from artemis-log-annotation-processor/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/SimpleBundleTest.java
rename to artemis-log-annotation-processor/tests/src/test/java/org/apache/activemq/artemis/logs/annotation/processor/SimpleBundleTest.java
diff --git a/artemis-pom/pom.xml b/artemis-pom/pom.xml
index 711e91f799..30adb9440a 100644
--- a/artemis-pom/pom.xml
+++ b/artemis-pom/pom.xml
@@ -852,4 +852,32 @@
</dependencies>
</dependencyManagement>
+
+ <profiles>
+ <profile>
+ <id>log-bundle-annotation-processor</id>
+ <activation>
+ <file>
+ <exists>${basedir}/enable-log-bundle-annotation-processor</exists>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths combine.children="append">
+ <path>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-log-annotation-processor</artifactId>
+ <version>${project.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/artemis-protocols/artemis-amqp-protocol/enable-log-bundle-annotation-processor b/artemis-protocols/artemis-amqp-protocol/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-protocols/artemis-mqtt-protocol/enable-log-bundle-annotation-processor b/artemis-protocols/artemis-mqtt-protocol/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-protocols/artemis-stomp-protocol/enable-log-bundle-annotation-processor b/artemis-protocols/artemis-stomp-protocol/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-ra/enable-log-bundle-annotation-processor b/artemis-ra/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-server-osgi/enable-log-bundle-annotation-processor b/artemis-server-osgi/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-server/enable-log-bundle-annotation-processor b/artemis-server/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-service-extensions/enable-log-bundle-annotation-processor b/artemis-service-extensions/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-web/enable-log-bundle-annotation-processor b/artemis-web/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/artemis-website/enable-log-bundle-annotation-processor b/artemis-website/enable-log-bundle-annotation-processor
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/pom.xml b/pom.xml
index 314b91779c..d89d5a1613 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,9 +30,13 @@
</parent>
<modules>
+ <!-- Modules that use artemis-project as their parent -->
<module>artemis-bom</module>
- <module>artemis-pom</module>
<module>artemis-log-annotation-processor</module>
+ <module>artemis-pom</module>
+
+ <!-- Other modules, use artemis-pom as their parent -->
+ <module>artemis-log-annotation-processor/tests</module>
<module>artemis-protocols</module>
<module>artemis-dto</module>
<module>artemis-cdi-client</module>
@@ -307,14 +311,6 @@
<name>errorprone</name>
</property>
</activation>
- <dependencies>
- <dependency>
- <groupId>com.google.errorprone</groupId>
- <artifactId>error_prone_core</artifactId>
- <version>${errorprone.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
<build>
<plugins>
<plugin>
@@ -326,6 +322,13 @@
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne -Xep:ThreadLocalUsage:ERROR -Xep:MissingOverride:ERROR -Xep:NonAtomicVolatileUpdate:ERROR -Xep:SynchronizeOnNonFinalField:ERROR -Xep:StaticQualifiedUsingExpression:ERROR -Xep:WaitNotInLoop:ERROR -Xep:BanJNDI:OFF -XepExcludedPaths:.*/generated-sources/.*</arg>
</compilerArgs>
+ <annotationProcessorPaths combine.children="append">
+ <path>
+ <groupId>com.google.errorprone</groupId>
+ <artifactId>error_prone_core</artifactId>
+ <version>${errorprone.version}</version>
+ </path>
+ </annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
@@ -340,14 +343,6 @@
<name>errorprone</name>
</property>
</activation>
- <dependencies>
- <dependency>
- <groupId>com.google.errorprone</groupId>
- <artifactId>error_prone_core</artifactId>
- <version>${errorprone.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
<build>
<plugins>
<plugin>
@@ -370,6 +365,13 @@
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
</compilerArgs>
+ <annotationProcessorPaths combine.children="append">
+ <path>
+ <groupId>com.google.errorprone</groupId>
+ <artifactId>error_prone_core</artifactId>
+ <version>${errorprone.version}</version>
+ </path>
+ </annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
@@ -946,6 +948,7 @@
<exclude>**/*.pemcfg</exclude>
<exclude>**/org/apache/activemq/artemis/utils/json/**</exclude>
<exclude>**/org/apache/activemq/artemis/utils/Base64.java</exclude>
+ <exclude>**/enable-log-bundle-annotation-processor</exclude>
<exclude>**/.settings/**</exclude>
<exclude>**/.project</exclude>
<exclude>**/.classpath</exclude>
@@ -1008,6 +1011,25 @@
<arguments>-DskipTests</arguments>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <!-- This is a dummy path, it has no processor, used here to stop
+ implicit processor search of main dependencies.
+ Append desired paths to annotationProcessorPaths in child
+ module poms to enable the desired processors.
+ Avoids use of 'proc:full', which needs newest JDK < 21 builds -->
+ <path>
+ <groupId>org.apache.apache.resources</groupId>
+ <artifactId>apache-jar-resource-bundle</artifactId>
+ <version>${version.apache-resource-bundles}</version>
+ </path>
+ </annotationProcessorPaths>
+ <annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@activemq.apache.org
For additional commands, e-mail: commits-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact