odpi / egeria

Egeria core
https://egeria-project.org
Apache License 2.0
795 stars 259 forks source link

Egeria fails in delombok with jdk 16 #5101

Closed planetf1 closed 3 years ago

planetf1 commented 3 years ago

Egeria 2.9 builds fine with openjdk 16

However master is failing with an error from our lombok processing.

Whilst we target JDK 8 as a minimum, and JDK 11 is a requirement (current LTS), we aim to try and keep the code building on latest java levels.

11:38:51,536 [ERROR] Failed to execute goal org.projectlombok:lombok-maven-plugin:1.18.18.0:delombok (delombok) on project audit-log-framework: Execution delombok of goal org.projectlombok:lombok-maven-plugin:1.18.18.0:delombok failed: An API incompatibility was encountered while executing org.projectlombok:lombok-maven-plugin:1.18.18.0:delombok: java.lang.IllegalAccessError: class lombok.delombok.Delombok (in unnamed module @0x7591cbd1) cannot access class com.sun.tools.javac.tree.JCTree$JCCompilationUnit (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.tree to unnamed module @0x7591cbd1
11:38:51,537 [ERROR] -----------------------------------------------------
11:38:51,537 [ERROR] realm =    plugin>org.projectlombok:lombok-maven-plugin:1.18.18.0
11:38:51,537 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
11:38:51,537 [ERROR] urls[0] = file:/Users/jonesn/.m2/repository/org/projectlombok/lombok-maven-plugin/1.18.18.0/lombok-maven-plugin-1.18.18.0.jar
11:38:51,537 [ERROR] urls[1] = file:/Users/jonesn/.m2/repository/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar
11:38:51,538 [ERROR] urls[2] = file:/Users/jonesn/.m2/repository/org/projectlombok/lombok/1.18.18/lombok-1.18.18.jar
11:38:51,538 [ERROR] urls[3] = file:/Users/jonesn/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
11:38:51,538 [ERROR] urls[4] = file:/Users/jonesn/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.jar
11:38:51,538 [ERROR] Number of foreign imports: 1
11:38:51,538 [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
11:38:51,539 [ERROR]
11:38:51,539 [ERROR] -----------------------------------------------------
planetf1 commented 3 years ago

This looks like use by lombok of undocumented java APIs (which I think lombok users are aware of).

More info at https://github.com/projectlombok/lombok/issues/2681

There's a long discussion about use of Internal APIs. I note that lombok 1.18.20 purports to support JDK 16 (at least openjdk?) & 5.3.3.3 for the gradle plugin