Closed timtebeek closed 1 year ago
Hi @timtebeek, could you let me know which version of Gradle and JDK are you using?
Also FWIW the JReleaser plugins consume v0.46.6
of the KGP which is coming from the gradle6
branch.
Absolutely; sorry for not including that immediately;
I'm using sdk use java 11.0.17-tem
for my JDK,
and running the included Gradle wrapper 6.9.3.
Well this is weird. When the suggested init script is applied the jdks-gradle-plugin
is no longer configured as expected as the gradlePlugin
extension is not available and thus making the following expressions evaluate to null: project.project.extensions.findByType(GradlePluginDevelopmentExtension)
.
Glad to see you found a way around the problem with your commit! I'll keep an eye on how the next release of kordamp-gradle-plugins
affects our use of init.gradle
once adopted into jreleaser. Thanks for the help!
v0.46.7
will be released later this week. Once it happens I’ll update the JReleaser build and let you know when ready.
FWIW I think the cause of this issue is the eager evaluation of tasks to be filtered. I saw such code in the init script.
Thanks! I've passed your comment along to hopefully get that sorted on our end. I'm learning a lot still. :)
v0.46.7
is out and JReleaser has it configured https://github.com/jreleaser/jreleaser/commit/36dbf943292b4ad50505a182b70ab0ed29c8d6f6
Thank you for the quick work on that one! Before the new plugin ingestion on our end failed with the above error after 2 minutes. After the new plugin we get up to 14 minutes of tasks being executed before it ultimately fails on our end.
Task :jreleaser-graalvm-sdk:compileJava FAILED /home/ubuntu/jenkins-agent/workspace/ingest/jreleaser_jreleaser/sdks/jreleaser-graalvm-sdk/src/main/java/org/jreleaser/graalvm/sdk/signing/BouncyCastleFeature.java:21: error: cannot access org.graalvm.nativeimage.hosted.Feature import org.graalvm.nativeimage.hosted.Feature; ^ bad class file: /home/ubuntu/.gradle/caches/modules-2/files-2.1/org.graalvm.sdk/graal-sdk/22.3.0/83179e3310a2ece87266923fede5ef7355c68c9a/graal-sdk-22.3.0.jar(org/graalvm/nativeimage/hosted/Feature.class) class file has wrong version 55.0, should be 52.0 Please remove or make sure it appears in the correct subdirectory of the classpath.
Which is weird, because we have the project configured to use Java 8. Either way, that's something for us to debug; thanks for helping out!
As you saw I managed to create https://github.com/jreleaser/jreleaser/pull/1169 by hand, so at least for now I don't think there's an immediate need for other recipes to run. Let me know if you'd like to include anything else! :)
JReleaser's build requires Java 11.
I thought we had removed the BouncyCastleFeature class as the Feature annotation is deprecated. Will have to double check.
And one more thing: thank you for the PR. I left one small comment I hope you can address before merging.
Ah that's good to know; bumped the ingestion to Java 11 just now and will try again! The BouncyCastleFeature class is still there, although it sound like you're on it already. :) And I hadn't seen any comments on https://github.com/jreleaser/jreleaser/pull/1169 yet; is that still a draft? Happy to update it.
Now I remember. The BouncyCastleFeature
class is indeed required, what changed is how it was registered. It previously used an annotation that has been deprecated. This is one of the reasons for the build requiring Java 11.
Also, noticed the comment I left at https://github.com/jreleaser/jreleaser/pull/1169 was in pending
state. It should be visible now.
https://github.com/kordamp/kordamp-gradle-plugins/blob/master/plugins/plugin-gradle-plugin/src/main/groovy/org/kordamp/gradle/plugin/plugin/PluginPlugin.groovy#L81
Appologies, this could be rather niche, but bear with me, it's for a good cause. :sweat_smile:
When running a build of jreleaser, with a Gradle init script, which adds a plugin, that leads to a NPE in PluginPlugin.groovy#L81.
Line 81 does quite a few things, and it's not immediately clear to me what part exactly is throwing the NPE. And my fairly limited exposure to Gradle so far is making it hard for me to learn more or debug this properly.
Here's the full stacktrace.
The goal here is to fix the import of jreleaser into public.moderne.io, so I can more easily run recipes to improve the code base, and hopefully (still) resolve some of the Sonar issues found there recently. So any help appreciated & hopefully repaid! :)