jponge / vertx-gradle-plugin

An opinionated Gradle plugin for Vert.x projects
Apache License 2.0
113 stars 15 forks source link

vertxRun fails with java.lang.NoClassDefFoundError: org/gradle/api/plugins/MavenPlugin #71

Open ahmedriza opened 1 year ago

ahmedriza commented 1 year ago

Thanks for this plugin. Just started to use it and ran into this error:

* What went wrong:
org/gradle/api/plugins/MavenPlugin
> org.gradle.api.plugins.MavenPlugin

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
java.lang.NoClassDefFoundError: org/gradle/api/plugins/MavenPlugin
        at com.github.jengelman.gradle.plugins.shadow.ShadowApplicationPlugin.apply(ShadowApplicationPlugin.groovy:43)
        at com.github.jengelman.gradle.plugins.shadow.ShadowApplicationPlugin.apply(ShadowApplicationPlugin.groovy)
...

I believe this is due to the old version of the Shadow plugin (6.1.0) being used which relies on the MavenPlugin: https://github.com/johnrengelman/shadow/blob/6.1.0/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowApplicationPlugin.groovy#L43

Can we upgrade to the new verison of Shadow please? 8.1.1 is out. Thanks.

My Gradle version info:

------------------------------------------------------------
Gradle 8.1.1
------------------------------------------------------------

Build time:   2023-04-21 12:31:26 UTC
Revision:     1cf537a851c635c364a4214885f8b9798051175b

Kotlin:       1.8.10
Groovy:       3.0.15
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.7 (Homebrew 17.0.7+0)
OS:           Mac OS X 13.3.1 aarch64

I tried manually updating the Shadow plugin to 8.1.1, but my local build of this plugin fails with:

Caused by: java.lang.RuntimeException: Please configure the `shadowJar` task to not add a classifier to the jar it produces
        at com.gradle.publish.PublishTaskShadowAction.manipulateVariants(PublishTaskShadowAction.java:37)

I guess things have changed in the Shadow land.

aleksandar78 commented 1 year ago

I have the same problem after updating my project to Gradle 8.2.1 and JDK 17. The change made by Gradle was announced a long time ago. IMO, there is no workaround for this kind of problem. A dependency update is required for sure.

apatrida commented 10 months ago

Is this plugin deprecated?

jponge commented 10 months ago

It's not been actively maintained but I'll gladly take PRs to make it work with current Gradle versions.

It's always been a challenge to go through frequent breaking changes in Gradle, sadly.