mattcasters opened a new issue, #8406:
URL: https://github.com/apache/hop/issues/8406

   ### Apache Hop version?
   
   2.20.0-SNAPSHOT (after #8325)
   
   ### Java version?
   
   OpenJDK 21
   
   ### Operating system
   
   Linux
   
   ### What happened?
   
   After #8325 switched the build to the Eclipse compiler 
(`compilerId=eclipse`, `plexus-compiler-eclipse` 2.17.0), `mvn clean install` 
fails on the first Java module (`hop-core`) with:
   
   ```
   [INFO] --- maven-compiler-plugin:3.16.0:compile (default-compile) @ hop-core 
---
   [ERROR] Compiler 'eclipse' could not be instantiated or injected properly. 
If you spelled the compiler ID correctly and all necessary dependencies are on 
the classpath, then next you can try running the build with -Dsisu.debug, 
looking for exceptions. TypeNotPresentException caused by 
UnsupportedClassVersionError might indicate, that the compiler needs a more 
recent Java runtime. IllegalArgumentException in ClassReader.<init> might mean, 
that you need to upgrade Maven.
   [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.16.0:compile (default-compile) 
on project hop-core: No such compiler 'eclipse'.
   ```
   
   This happens with the **distro Maven** on both:
   
   - Ubuntu 24.04 LTS — Maven **3.8.7**
   - Ubuntu 26.04 LTS — Maven **3.9.12**
   
   `./mvnw` (Apache Maven 3.9.12 tarball) gets past compiler injection, but 
that is not a workable developer flow: the wrapper is easy to skip, and the 
Lombok ECJ agent was attached only on the root aggregator (`inherited=false`). 
`cd core && mvn compile` and `mvn -pl core` therefore never attach Lombok, so a 
single-module build is unusable even when the compiler itself loads.
   
   #### Cause
   
   Debian/Ubuntu Maven does **not** ship the Sisu that Apache Maven 3.9.x 
bundles (`org.eclipse.sisu.inject` 0.9.x). It uses the distro 
`libsisu-inject-java`:
   
   | Distro | Maven package | Sisu |
   | --- | --- | --- |
   | Ubuntu 24.04 | 3.8.7 | 0.3.4 |
   | Ubuntu 26.04 | 3.9.12 | 0.3.5 |
   
   That Sisu shades an old ASM. `org.eclipse.sisu.space.asm.ClassReader` 
rejects any class file newer than **Java 14** (major version 58 / 
`Opcodes.V14`):
   
   ```
   bipush 58
   if_icmple <ok>
   new IllegalArgumentException
   athrow
   ```
   
   `plexus-compiler-eclipse` 2.17.0 is compiled for **Java 17** (major 61) and 
is indexed only via `@Named` / `META-INF/sisu/javax.inject.Named`. Sisu 
therefore fails while scanning `EclipseJavaCompiler.class`:
   
   ```
   Problem scanning: 
.../plexus-compiler-eclipse-2.17.0.jar!/.../EclipseJavaCompiler.class
   java.lang.IllegalArgumentException
       at org.eclipse.sisu.space.asm.ClassReader.<init>(ClassReader.java:170)
   ```
   
   The JVM is Java 21 and can *run* that class; only the Sisu index scan fails. 
`compilerId=eclipse` is never registered, so the compiler plugin reports "No 
such compiler 'eclipse'".
   
   Upgrading the Ubuntu Maven *package* to 3.9.12 does not help, because the 
Sisu on the distro classpath is still 0.3.x. The Apache tarball/wrapper works 
because it bundles Sisu 0.9.0.M4, whose ASM can read Java 17 classes.
   
   A second, independent problem in the same setup: the Lombok ECJ javaagent 
was copied and attached only on the root POM. Single-module builds never ran 
that `validate` execution, so ECJ compiled without Lombok (missing 
getters/setters) unless the full reactor had already attached the agent in that 
JVM.
   
   #### Workaround
   
   Use `./mvnw` from the repository root (Apache Maven 3.9.12) for a full 
reactor build. That still does not restore `cd <module> && mvn`.
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: Infrastructure


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to