micronaut-projects / micronaut-gradle-plugin

A Gradle Plugin for Micronaut
Apache License 2.0
65 stars 43 forks source link

java.lang.NoClassDefFoundError: org/jetbrains/kotlin/gradle/dsl/KotlinCompile while synchronizing Kotlin project #1006

Open musketyr opened 2 weeks ago

musketyr commented 2 weeks ago

Expected Behavior

Koltin project synchronizes properly in IntelliJ

Actual Behaviour

The project fails synchronization with

java.lang.NoClassDefFoundError: org/jetbrains/kotlin/gradle/dsl/KotlinCompile   
at io.micronaut.gradle.MicronautKotlinSupport.configureKotlin(MicronautKotlinSupport.java:78)   
at io.micronaut.gradle.MicronautKotlinSupport.lambda$whenKotlinSupportPresent$0(MicronautKotlinSupport.java:49)

see e.g. https://scans.gradle.com/s/22eoxo6xfyjrs/failure

Steps To Reproduce

  1. clone Micronaut AWS SDK repository branch that re-enabled Kotlin subproject
  2. synchronize the project in IntelliJ or simply run some Gradle task such as classes
  3. You got the error similar to this one

Environment Information

Operating system macOS 14.2.1 (aarch64)
Java runtime Azul Zulu OpenJDK Runtime Environment 21.0.2+13-LTS Java VM Azul Zulu OpenJDK 64-Bit Server VM 21.0.2+13-LTS (mixed mode, sharing)

Example Application

https://github.com/agorapulse/micronaut-aws-sdk/pull/244

Version

4.5.0

melix commented 2 weeks ago

I think I've seen this before and it was caused by an incorrect project setup (e.g multiple kotlin plugins on classpath)

musketyr commented 2 weeks ago

Thanks! I will try to dig deeper if this is the case.