question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible regression in 0.28.0 with Gradle 5.1.1, dependencyUpdates fails with ref to org/gradle/api/artifacts/CapabilitiesResolution

See original GitHub issue

The release notes on v 0.28.0 state:

Note: the Gradle Versions Plugin now requires at least Gradle 5.0 to function.

When we execute dependencyUpdates task in Gradle 5.1.1 in our project it fails though with

> Task :dependencyUpdates FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dependencyUpdates'.
> org/gradle/api/artifacts/CapabilitiesResolution

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':dependencyUpdates'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)
...
Caused by: java.lang.NoClassDefFoundError: org/gradle/api/artifacts/CapabilitiesResolution
        at java.desktop/com.sun.beans.introspect.MethodInfo.get(MethodInfo.java:71)
        at java.desktop/com.sun.beans.introspect.ClassInfo.getMethods(ClassInfo.java:71)
        at com.github.benmanes.gradle.versions.updates.resolutionstrategy.ResolutionStrategyWithCurrent.$getStaticMetaClass(ResolutionStrategyWithCurrent.groovy)
        at com.github.benmanes.gradle.versions.updates.resolutionstrategy.ResolutionStrategyWithCurrent.<init>(ResolutionStrategyWithCurrent.groovy)
        at com.github.benmanes.gradle.versions.updates.Resolver$1.execute(Resolver.groovy:192)
        at com.github.benmanes.gradle.versions.updates.Resolver$1.execute(Resolver.groovy)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolutionStrategy(DefaultConfiguration.java:992)
        at com.github.benmanes.gradle.versions.updates.Resolver.addCustomResolutionStrategy(Resolver.groovy:189)
        at com.github.benmanes.gradle.versions.updates.Resolver.createLatestConfiguration(Resolver.groovy:137)
        at com.github.benmanes.gradle.versions.updates.Resolver.resolve(Resolver.groovy:76)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolve(DependencyUpdates.groovy:85)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates.access$0(DependencyUpdates.groovy)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates$_resolveProjects_closure6$_closure10.doCall(DependencyUpdates.groovy:75)
        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 com.github.benmanes.gradle.versions.updates.DependencyUpdates$_resolveProjects_closure6.doCall(DependencyUpdates.groovy:70)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates$_resolveProjects_closure6.call(DependencyUpdates.groovy)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolveProjects(DependencyUpdates.groovy:67)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates.run(DependencyUpdates.groovy:55)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask.dependencyUpdates(DependencyUpdatesTask.groovy:100)
...
Caused by: java.lang.ClassNotFoundException: org.gradle.api.artifacts.CapabilitiesResolution
        ... 93 more

while it still works with 0.27.0.

Looking at https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/CapabilitiesResolution.html it looks like the class is only available since Gradle 5.6.

We do have a custom resolution strategy but I have no clue how CapabilitiesResolution comes into the picture with 0.28.0.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jaredsburrowscommented, May 3, 2022

@JoergHeinicke5005 Are you still seeing this? We have a test with Gradle 5.1.1 here: https://github.com/ben-manes/gradle-versions-plugin/blob/master/src/test/groovy/com/github/benmanes/gradle/versions/DifferentGradleVersionsSpec.groovy#L101.

If you are still able to repro, please leave a comment.

1reaction
ben-manescommented, Mar 10, 2020

Yep, that would be great. I think we should get try to reproduce the failure first, though. Even better if we can add as an integration test, e.g. external build call, since this seems really easy to reintroduce by mistake.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle 5.1.1 does not retry connection resets #8264 - GitHub
I'm behind a corp proxy and can confirm this behavior. Even with the settings beneath, some of my builds are failing because of...
Read more >
Upgrading your build from Gradle 5.x to 6.0
The previous step will help you identify potential problems by issuing deprecation warnings when a plugin does try to use a deprecated part...
Read more >
Gradle 5.1.1 Release Notes
It is now possible to match repositories to dependencies, so that Gradle doesn't search for a dependency in a repository if it's never...
Read more >
Gradle 7.5.1 Release Notes
Starting with Gradle 7.5 it is now possible to declare dependency resolution results as task inputs. This allows writing tasks which consume dependency ......
Read more >
Releases - Gradle
Find binaries and reference documentation for current and past versions of Gradle.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found