Skip to content
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

Latest version 0.43.0 requires Gradle 7 #702

Closed
twwwt opened this issue Oct 17, 2022 · 4 comments
Closed

Latest version 0.43.0 requires Gradle 7 #702

twwwt opened this issue Oct 17, 2022 · 4 comments

Comments

@twwwt
Copy link

twwwt commented Oct 17, 2022

After upgrading from version 0.42.0 to 0.43.0, and using Gradle 6.9.1, I get the following exception:

Caused by: java.lang.NoClassDefFoundError: groovy/xml/XmlSlurper
        at com.github.benmanes.gradle.versions.updates.Resolver$Companion.getUrlFromPom(Resolver.kt:420)
        at com.github.benmanes.gradle.versions.updates.Resolver$Companion.access$getUrlFromPom(Resolver.kt:418)
        at com.github.benmanes.gradle.versions.updates.Resolver.resolveProjectUrl(Resolver.kt:373)
        at com.github.benmanes.gradle.versions.updates.Resolver.getProjectUrl(Resolver.kt:352)
        at com.github.benmanes.gradle.versions.updates.Resolver.getStatus(Resolver.kt:74)
        at com.github.benmanes.gradle.versions.updates.Resolver.resolve(Resolver.kt:57)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolve(DependencyUpdates.kt:86)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolveProjects(DependencyUpdates.kt:72)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates.run(DependencyUpdates.kt:40)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask.dependencyUpdates(DependencyUpdatesTask.kt:129)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
[...]

Using Gradle 7.5.1, however, it works. Was it intentional to require Gradle 7 with the latest release? Otherwise, I would like to ask to restore compatibility with Gradle 6.

@ben-manes
Copy link
Owner

I think this was due to Gradle upgrading their version of Groovy which moved the package around (#656). We do run tests against older versions, which passes for 5.0+ so we had hoped it would not regress.

You are welcome to send a PR if we can restore that functionality, but otherwise I think it's okay to have a new minimum required version and users on older version can use earlier plugin versions. In that case we might want to update the error message rather than showing a stacktrace (our minimum version check).

@twwwt
Copy link
Author

twwwt commented Oct 18, 2022

I think this was due to Gradle upgrading their version of Groovy which moved the package around (#656).

Groovy 2 has groovy.util.XmlSlurper, while Groovy 3 has groovy.xml.XmlSlurper, the latter being what you use now. Gradle 6 uses Groovy 2, Gradle 7 uses Groovy 3. So, either you want to use Groovy 3 (which implies minimum required version is Gradle 7), or you do not. Do you want to?

We do run tests against older versions, which passes for 5.0+ so we had hoped it would not regress.

I doubt that these tests still run with Gradle 5; do they? If they do, the only thing I can imagine is that you have implemented a kind of dynamic switching between the two XMLSlurper variants depending on what is found in the classpath and that works with Gradle 5 and 7, but not 6.

You are welcome to send a PR if we can restore that functionality, but otherwise I think it's okay to have a new minimum required version and users on older version can use earlier plugin versions. In that case we might want to update the error message rather than showing a stacktrace (our minimum version check).

Actually, I'm fine with using a previous version of the plugin to get it working with Gradle 6. I just wanted to know what your intentions are and what the minimum Gradle version is that the plugin requires. There is no changelog nor did I find any other documentation from which I can get that information.

@ben-manes
Copy link
Owner

Okay, I updated the release notes so that hopefully others won't be caught by surprise. thanks!

@ben-manes
Copy link
Owner

Oh, and yes the tests run with different versions. I don't know why they pass either.

DifferentGradleVersionsSpec > dependencyUpdates task completes without errors with Gradle #gradleVersion > com.github.benmanes.gradle.versions.DifferentGradleVersionsSpec.dependencyUpdates task completes without errors with Gradle 5.0 STANDARD_OUT
    Downloading https://services.gradle.org/distributions/gradle-5.0-bin.zip
    .................................................................................

DifferentGradleVersionsSpec > dependencyUpdates task completes without errors with Gradle #gradleVersion > com.github.benmanes.gradle.versions.DifferentGradleVersionsSpec.dependencyUpdates task completes without errors with Gradle 5.0 PASSED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants