-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NoClassDefFoundError: org/gradle/internal/classpath/Instrumented #18
Comments
This is strange. The source does not make reference to internal APIs, it's written in Java so there should not be a dependence on an specific Gradle version as it happens when Groovy code is compiled AFAICT https://github.com/kordamp/jandex-gradle-plugin/blob/master/src/main/java/org/kordamp/gradle/plugin/jandex/tasks/JandexMain.java |
I just tried this on an empty/blank Quarkus project and it builds. Once the |
gradle/gradle#14727 could be this bug? Is there a way we can work around it? |
Do you have a reproducible project? |
Do you get the failure with an earlier Gradle version? say 7.4? |
7.4.2 is fine. Failure is with 7.5-rc-1. Could be a gradle bug itself or a change of APIs / functionality that has resulted in this. Don't have a specific project yet. Just went to the Quarkus website, checked out a sample and added this plugin to it and triggered the issue. |
The plugin reads compiled classes from the output of the I don't have access to a computer right now but perhaps running a simple project in debug mode with 7.4.2 vs 7.5 should result in logging the execution classpath used by the JandexMain class. With any luck this should show if a JAR is missing. If not then the annotation used to be located in an existing JAR. In any case I don't think there's a workaround if Gradle 7.5 is required. If my suspicion is correct then reading classes to be processed must be done in a different way. |
Turns out the bug is in setting up the classpath that invokes the JavaExec type that runs JandexMain. I know how to fix this. Expect a release in the coming days. |
Any luck on fixing this? Thanks! |
I'm just building against the released version of gradle, 7.5 and getting this error.
Gradle 7.5Build time: 2022-07-14 12:48:15 UTC Kotlin: 1.6.21
|
@aalmiray hey. Any chance this issue could be fixed? It's blocking the Quarkus upgrade to Gradle 7.5. Thanks! |
@gsmet currently looking at it. It appears I'll have to switch to Gradle's Worker API to make it work. Thing is, I'm still learning how to use said API. Hope to get a release ready this week. |
@gsmet version |
Thanks! @glefloch can you have a look? |
Thanks @aalmiray, I will update quarkus sample projects |
Running this with Gradle
7.5-rc-1
and Java 18.Getting the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/gradle/internal/classpath/Instrumented at org.kordamp.gradle.plugin.jandex.tasks.JandexMain$ClassFileVisitor.indexFile(JandexMain.java:172) at org.kordamp.gradle.plugin.jandex.tasks.JandexMain$ClassFileVisitor.visitFile(JandexMain.java:160) at org.kordamp.gradle.plugin.jandex.tasks.JandexMain$ClassFileVisitor.visitFile(JandexMain.java:147) at java.base/java.nio.file.Files.walkFileTree(Files.java:2812) at java.base/java.nio.file.Files.walkFileTree(Files.java:2883) at org.kordamp.gradle.plugin.jandex.tasks.JandexMain.execute(JandexMain.java:98) at org.kordamp.gradle.plugin.jandex.tasks.JandexMain.run(JandexMain.java:124) at org.kordamp.gradle.plugin.jandex.tasks.JandexMain.main(JandexMain.java:111) Caused by: java.lang.ClassNotFoundException: org.gradle.internal.classpath.Instrumented at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 8 more
The text was updated successfully, but these errors were encountered: