This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new ddef53fed5 [build] setup ECJ compilation (#8325)
ddef53fed5 is described below
commit ddef53fed5a117a3978b59c8ee5e37888cbace8f
Author: Romain Manni-Bucau <[email protected]>
AuthorDate: Mon Sep 14 08:31:11 2026 +0200
[build] setup ECJ compilation (#8325)
---
.mvn/extensions.xml | 26 +++++++++--
.mvn/jvm.config | 4 +-
lib/pom.xml | 12 +++++
plugins/actions/xml/pom.xml | 6 +++
plugins/tech/cassandra/pom.xml | 50 +++++++++++++++++++++
pom.xml | 100 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 194 insertions(+), 4 deletions(-)
diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml
index ec0a849f89..cb5d494719 100644
--- a/.mvn/extensions.xml
+++ b/.mvn/extensions.xml
@@ -16,9 +16,29 @@
~ limitations under the License.
-->
<extensions>
+ <!-- not really needed by default and quite outdated
<extension>
- <groupId>co.leantechniques</groupId>
- <artifactId>maven-buildtime-extension</artifactId>
- <version>3.0.3</version>
+ <groupId>co.leantechniques</groupId>
+ <artifactId>maven-buildtime-extension</artifactId>
+ <version>3.0.3</version>
+ <extension>
+ -->
+ <!--
+ $ docker run -d \
+ -p 16686:16686 \
+ -p 4317:4317 \
+ -p 4318:4318 \
+ jaegertracing/jaeger
+ $ mvn \
+ -Dotel.traces.exporter=otlp \
+ -Dotel.exporter.otlp.endpoint=http://localhost:4317 \
+ -Dotel.instrumentation.maven.transfer.enabled=false \
+ -DskipTests
+ clean install -T0.75C
+ <extension>
+ <groupId>io.opentelemetry.contrib</groupId>
+ <artifactId>opentelemetry-maven-extension</artifactId>
+ <version>1.55.0-alpha</version>
</extension>
+ -->
</extensions>
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
index f061e563ec..bc62036624 100644
--- a/.mvn/jvm.config
+++ b/.mvn/jvm.config
@@ -18,4 +18,6 @@
--add-opens java.security.jgss/sun.security.krb5=ALL-UNNAMED
--add-exports java.base/sun.nio.ch=ALL-UNNAMED
-Dorg.slf4j.simpleLogger.log.org.jacoco.maven.AgentMojo=warn
--Dorg.slf4j.simpleLogger.log.org.jacoco.maven.AgentITMojo=warn
\ No newline at end of file
+-Dorg.slf4j.simpleLogger.log.org.jacoco.maven.AgentITMojo=warn
+-Djdk.attach.allowAttachSelf=true
+-XX:+EnableDynamicAgentLoading
\ No newline at end of file
diff --git a/lib/pom.xml b/lib/pom.xml
index d6f61f044e..2fb683fd58 100644
--- a/lib/pom.xml
+++ b/lib/pom.xml
@@ -844,6 +844,18 @@
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>${xerces.version}</version>
+ <exclusions>
+ <!-- ECJ (our maven-compiler-plugin compilerId) refuses
jars
+ shipping classes in packages exported by JDK modules:
+ xml-apis ships javax.xml.*, org.w3c.dom and
org.xml.sax,
+ all split packages vs the java.xml module. The JDK 21
+ provides these APIs so xml-apis is not needed at
runtime
+ either. -->
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
diff --git a/plugins/actions/xml/pom.xml b/plugins/actions/xml/pom.xml
index 5473300691..85ea2b04f5 100644
--- a/plugins/actions/xml/pom.xml
+++ b/plugins/actions/xml/pom.xml
@@ -51,6 +51,12 @@
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
</project>
diff --git a/plugins/tech/cassandra/pom.xml b/plugins/tech/cassandra/pom.xml
index 671b97337f..8a94b4a68b 100644
--- a/plugins/tech/cassandra/pom.xml
+++ b/plugins/tech/cassandra/pom.xml
@@ -31,6 +31,7 @@
<properties>
<cassandra-all.version>4.1.11</cassandra-all.version>
<cassandra-java-driver.version>4.17.0</cassandra-java-driver.version>
+ <high-scale-lib.version>1.0.6</high-scale-lib.version>
</properties>
<dependencyManagement>
@@ -97,6 +98,16 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
+ <!-- ECJ (our maven-compiler-plugin compilerId) refuses jars
that
+ ship classes in java.* packages: split package vs
java.base.
+ high-scale-lib ships java/util/Hashtable.class and
+ java/util/concurrent/ConcurrentHashMap.class; Cassandra
still
+ needs it at runtime so it is copied into the plugin zip by
+ the dependency plugin execution below instead. -->
+ <exclusion>
+ <groupId>com.boundary</groupId>
+ <artifactId>high-scale-lib</artifactId>
+ </exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>*</artifactId>
@@ -125,6 +136,13 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
</exclusion>
+ <!-- ECJ (see high-scale-lib above): sjk-cli ships
+ java/lang/ProcessBuilder.class. Only cassandra's nodetool
Sjk
+ command uses these so they are not needed by Hop at all.
-->
+ <exclusion>
+ <groupId>org.gridkit.jvmtool</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
<exclusion>
<groupId>org.lz4</groupId>
<artifactId>lz4-java</artifactId>
@@ -213,4 +231,36 @@
<scope>provided</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>ensure-high-scale-lib-in-plugin-zip</id>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ <configuration>
+ <!-- excluded from cassandra-all only to keep it
off the
+ ECJ compile classpath (java.* split package),
it is
+ still needed at runtime by Cassandra
caches/logging
+ so it must ship inside the plugin zip. -->
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.boundary</groupId>
+ <artifactId>high-scale-lib</artifactId>
+
<version>${high-scale-lib.version}</version>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${project.build.directory}/hop-plugin-lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/pom.xml b/pom.xml
index a47c414cff..bad31716f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -106,6 +106,8 @@
<byte-buddy.version>1.18.11</byte-buddy.version>
<commonmark.version>0.30.0</commonmark.version>
<cyclonedx-maven-plugin.version>2.9.3</cyclonedx-maven-plugin.version>
+ <gmavenplus-plugin.version>4.3.1</gmavenplus-plugin.version>
+ <groovy.version>4.0.28</groovy.version>
<grpc.version>1.83.1</grpc.version>
<hadoop.thirdparty.version>1.4.0</hadoop.thirdparty.version>
<hadoop.version>3.4.2</hadoop.version>
@@ -160,6 +162,7 @@
<objenesis.version>3.6</objenesis.version>
<opentelemetry.version>1.65.0</opentelemetry.version>
<org.eclipse.platform.version>3.134.0</org.eclipse.platform.version>
+ <plexus-compiler.version>2.17.0</plexus-compiler.version>
<project.build.outputTimestamp>1786535563</project.build.outputTimestamp>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -379,14 +382,111 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>ensure-lombok-ecj-agent-jar</id>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>${lombok.version}</version>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${maven.multiModuleProjectDirectory}/.mvn</outputDirectory>
+ <overWriteIfNewer>false</overWriteIfNewer>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
+ <version>${gmavenplus-plugin.version}</version>
+ <inherited>false</inherited>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.groovy</groupId>
+ <artifactId>groovy</artifactId>
+ <version>${groovy.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>attach-lombok-ecj-agent</id>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+
<skipScriptExecution>${lombok.ecj.agent.attached}</skipScriptExecution>
+ <scripts>
+ <script><![CDATA[
+import com.sun.tools.attach.VirtualMachine
+import java.nio.file.Files
+import java.nio.file.StandardCopyOption
+
+if (System.getProperty('lombok.ecj.agent.skip') != 'true') {
+ synchronized (System.getProperties()) {
+ if (System.getProperty('lombok.ecj.agent.attached') == null) {
+ def lombokJar = new
File(System.getProperty('maven.multiModuleProjectDirectory'), '.mvn/lombok-' +
project.properties['lombok.version'] + '.jar')
+ if (!lombokJar.isFile() || lombokJar.length() < 1000000L) {
+ throw new IllegalStateException('Lombok jar missing or
incomplete for the ECJ agent attach, expected ' + lombokJar)
+ }
+ def agentJar = Files.createTempFile('lombok-ecj-agent-',
'.jar').toFile()
+ agentJar.deleteOnExit()
+ Files.copy(lombokJar.toPath(), agentJar.toPath(),
StandardCopyOption.REPLACE_EXISTING)
+ try {
+ def vm =
VirtualMachine.attach(String.valueOf(ProcessHandle.current().pid()))
+ try {
+ vm.loadAgent(agentJar.absolutePath, 'ECJ')
+ } finally {
+ vm.detach()
+ }
+ System.setProperty('lombok.ecj.agent.attached', 'true')
+ log.info('Lombok ECJ agent attached (source: ' + lombokJar +
')')
+ } catch (Throwable t) {
+ throw new IllegalStateException('Unable to self-attach the
Lombok ECJ agent, ensure -Djdk.attach.allowAttachSelf=true is in
.mvn/jvm.config and the environment allows self-attach, or skip it with
-Dlombok.ecj.agent.skip=true', t)
+ }
+ }
+ }
+}
+ ]]></script>
+ </scripts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>3.16.0</version>
<configuration>
+ <compilerId>eclipse</compilerId>
<compilerArgs>
<arg>-Xlint:-options</arg>
</compilerArgs>
</configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-compiler-eclipse</artifactId>
+ <version>${plexus-compiler.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>${lombok.version}</version>
+ </dependency>
+ </dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>