eclipse-jkube / jkube

Build and Deploy java applications on Kubernetes
https://www.eclipse.dev/jkube/
Eclipse Public License 2.0
764 stars 508 forks source link

Project compilation fails when using OpenJDK 23 on Mac M2 #3462

Open arman-yekkehkhani opened 1 week ago

arman-yekkehkhani commented 1 week ago

Describe the bug

When using Java 23

$ java --verison
openjdk 23 2024-09-17
OpenJDK Runtime Environment (build 23+37-2369)
OpenJDK 64-Bit Server VM (build 23+37-2369, mixed mode, sharing)

compilation fails with the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project jkube-kit-common: Compilation failure: Compilation failure: 
[ERROR] /Users/snapp/IdeaProjects/jkube/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/access/ClusterConfiguration.java:[156,17] cannot find symbol
[ERROR]   symbol:   class ClusterConfigurationBuilder
[ERROR]   location: class org.eclipse.jkube.kit.common.access.ClusterConfiguration
[ERROR] /Users/snapp/IdeaProjects/jkube/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/access/ClusterConfiguration.java:[179,17] cannot find symbol
.
.
.
[ERROR] /Users/snapp/IdeaProjects/jkube/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/SpringBootUtil.java:[121,18] invalid method reference
[ERROR]   cannot find symbol
[ERROR]     symbol:   method getExecutions()
[ERROR]     location: class org.eclipse.jkube.kit.common.Plugin
[ERROR] /Users/snapp/IdeaProjects/jkube/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/SpringBootUtil.java:[142,54] cannot find symbol
[ERROR]   symbol:   method getBuildDirectory()
[ERROR]   location: variable project of type org.eclipse.jkube.kit.common.JavaProject
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :jkube-kit-common

switching to Java 21, everything goes back to normal.

Eclipse JKube version

SNAPSHOT

Component

JKube Kit

Apache Maven version

None

Gradle version

None

Steps to reproduce

  1. Use Java version 23 using sdk
    $ sdk use java 23-open
  2. Try running
    $ ./mvnw clean install -DskipTests

Expected behavior

Should compile normally like previous versions of Java

Runtime

other (please specify in additional context)

Kubernetes API Server version

1.25.3

Environment

macOS

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

manusa commented 1 week ago

That looks like an issue with lombok. Does Lombok support Java 23?

arman-yekkehkhani commented 1 week ago

@manusa Yeah, you are right! Lombok has not added support for JDK 23.

manusa commented 1 week ago

https://github.com/projectlombok/lombok/issues/3722

rohanKanojia commented 1 day ago

It's not just on JDK23, I see some test failures on MacOS when built against JDK17.

I tested it via GitHub actions, see logs.

arman-yekkehkhani commented 1 day ago

@rohanKanojia I can confirm the same thing. The issue seems similar to #3001 and #3006. I will make a PR to fix that!

manusa commented 4 hours ago

It's not just on JDK23, I see some test failures on MacOS when built against JDK17.

I tested it via GitHub actions, see logs.

Note that the failures are for different reasons, ones can be fixed others can't unless lombok provides a new release or we move away from lombok