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.

Kotlin-stdlib-jdk8 failed to resolve

See original GitHub issue

Hi I am facing this issue while executing the dependency Updates task. Failed to determine the latest version for the following dependencies (use --info for details):

  • org.jetbrains.kotlin:kotlin-stdlib-jdk8 1.4.21-2

The exception that is the cause of unresolved state: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2.
Required by:
    project :core
Caused by: org.gradle.internal.component.NoMatchingConfigurationSelectionException: No matching variant of org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2 was found. The consumer was configured to find a runtime of a library, with the library elements 'aar', and its dependencies declared externally, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' but:
  - Variant 'compile' capability org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2 declares a library:
      - Incompatible because this component declares an API of a component, packaged as a jar and the consumer needed a runtime of a component, with the library elements 'aar'
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
          - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  - Variant 'enforced-platform-compile' capability org.jetbrains.kotlin:kotlin-stdlib-jdk8-derived-enforced-platform:1.4.21-2:
      - Incompatible because this component declares an API of an enforced platform and the consumer needed a runtime of a library
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
          - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
          - Doesn't say anything about its elements (required them with the library elements 'aar')
  - Variant 'enforced-platform-runtime' capability org.jetbrains.kotlin:kotlin-stdlib-jdk8-derived-enforced-platform:1.4.21-2 declares a runtime of a component:
      - Incompatible because this component declares an enforced platform and the consumer needed a library
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
          - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
          - Doesn't say anything about its elements (required them with the library elements 'aar')
  - Variant 'platform-compile' capability org.jetbrains.kotlin:kotlin-stdlib-jdk8-derived-platform:1.4.21-2:
      - Incompatible because this component declares an API of a platform and the consumer needed a runtime of a library
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
          - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
          - Doesn't say anything about its elements (required them with the library elements 'aar')
  - Variant 'platform-runtime' capability org.jetbrains.kotlin:kotlin-stdlib-jdk8-derived-platform:1.4.21-2 declares a runtime of a component:
      - Incompatible because this component declares a platform and the consumer needed a library
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
          - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
          - Doesn't say anything about its elements (required them with the library elements 'aar')
  - Variant 'runtime' capability org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2 declares a runtime of a library:
      - Incompatible because this component declares a component, packaged as a jar and the consumer needed a component, with the library elements 'aar'
      - Other compatible attributes:
          - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
          - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
        at org.gradle.internal.component.model.AttributeConfigurationSelector.selectConfigurationUsingAttributeMatching(AttributeConfigurationSelector.java:112)
        at org.gradle.internal.component.model.AttributeConfigurationSelector.selectConfigurationUsingAttributeMatching(AttributeConfigurationSelector.java:51)
        at org.gradle.internal.component.model.LocalComponentDependencyMetadata.selectConfigurations(LocalComponentDependencyMetadata.java:144)
        at org.gradle.internal.component.local.model.DslOriginDependencyMetadataWrapper.selectConfigurations(DslOriginDependencyMetadataWrapper.java:62)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:248)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.attachToTargetConfigurations(EdgeState.java:148)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:364)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:249)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:186)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:145)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:128)
        at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:174)
        at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveGraph(ShortCircuitEmptyConfigurationResolver.java:85)
        at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveGraph(ErrorHandlingConfigurationResolver.java:74)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.run(DefaultConfiguration.java:620)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:395)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:387)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:84)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:611)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveExclusively$4(DefaultConfiguration.java:592)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$SafeExclusiveLockImpl.withLock(DefaultProjectStateRegistry.java:289)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusively(DefaultConfiguration.java:590)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:576)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:554)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
        at com.github.benmanes.gradle.versions.updates.Resolver.resolve(Resolver.groovy:80)
        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 jdk.internal.reflect.GeneratedMethodAccessor527.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
        at groovy.lang.Closure.call(Closure.java:405)
        at groovy.lang.Closure.call(Closure.java:421)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3574)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3559)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3659)
        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 org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3574)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3559)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3659)
        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)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:726)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:693)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:569)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:395)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:387)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:84)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:554)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:537)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:108)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:278)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:267)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
        at java.base/java.util.Optional.orElseGet(Optional.java:362)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
        at java.base/java.util.Optional.map(Optional.java:258)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
        at java.base/java.util.Optional.orElseGet(Optional.java:362)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:194)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:186)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.intern

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:7
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ben-manescommented, Mar 10, 2022

Gradle 7.3.3 + v42

Scan result

Build file
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'java-library'

buildscript {
  repositories {
    mavenLocal()
    gradlePluginPortal()
  }
  dependencies {
    classpath 'com.github.ben-manes:gradle-versions-plugin:0.42.0'
  }
}

repositories {
  mavenCentral()
}
dependencies {
  api 'org.jetbrains.kotlin:kotlin-script-runtime:1.1.0'
}
Task execution
$ gradle dU --scan

> Task :dependencyUpdates

------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------

The following dependencies have later milestone versions:
 - com.github.ben-manes:gradle-versions-plugin [0.42.0 -> 0.43.0]
 - org.jetbrains.kotlin:kotlin-script-runtime [1.1.0 -> 1.6.20-RC]
     https://kotlinlang.org/

Gradle release-candidate updates:
 - Gradle: [7.3.3 -> 7.4.1]

Generated report file build/dependencyUpdates/report.txt

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no] yes

Gradle Terms of Service accepted.

Publishing build scan...
https://gradle.com/s/a7ngbwnw66rv4

Gradle 7.4.1 + v42

Scan result

Build file
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'java-library'

buildscript {
  repositories {
    mavenLocal()
    gradlePluginPortal()
  }
  dependencies {
    classpath 'com.github.ben-manes:gradle-versions-plugin:0.42.0'
  }
}

repositories {
  mavenCentral()
}
dependencies {
  api 'org.jetbrains.kotlin:kotlin-script-runtime:1.1.0'
}
Task execution
$ gradle dU --scan
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

> Task :dependencyUpdates

------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------

The following dependencies have later milestone versions:
 - com.github.ben-manes:gradle-versions-plugin [0.42.0 -> 0.43.0]

Failed to determine the latest version for the following dependencies (use --info for details):
 - org.jetbrains.kotlin:kotlin-script-runtime
     1.6.20-RC

Gradle release-candidate updates:
 - Gradle: [7.4.1: UP-TO-DATE]

Generated report file build/dependencyUpdates/report.txt

BUILD SUCCESSFUL in 15s
1 actionable task: 1 executed

Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no] yes

Gradle Terms of Service accepted.

Publishing build scan...
https://gradle.com/s/3hegnchuw4qg4

Gradle 7.4.1 + v43 (isCanBeResolved() filter)

Scan result

Build file
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'java-library'

buildscript {
  repositories {
    mavenLocal()
    gradlePluginPortal()
  }
  dependencies {
    classpath 'com.github.ben-manes:gradle-versions-plugin:0.43.0'
  }
}

repositories {
  mavenCentral()
}
dependencies {
  api 'org.jetbrains.kotlin:kotlin-script-runtime:1.1.0'
}
Task execution
$ gradle dU --scan

> Task :dependencyUpdates

------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------

The following dependencies are using the latest milestone version:
 - com.github.ben-manes:gradle-versions-plugin:0.43.0

Gradle release-candidate updates:
 - Gradle: [7.4.1: UP-TO-DATE]

Generated report file build/dependencyUpdates/report.txt

BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed

Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no] yes

Gradle Terms of Service accepted.

Publishing build scan...
https://gradle.com/s/duwh5qd4li4jy

The change in the plugin was to add the if condition to skip those configurations, increment the version, and use publishToMavenLocal for access to this development version.

The plugin’s resolution logic has become more complex over the years, but fundamentally the idea was to uses the Gradle APIs,

https://github.com/ben-manes/gradle-versions-plugin/blob/fba92314f34b24bf93fc3fb4f2243e2e887ed12f/src/main/groovy/com/github/benmanes/gradle/versions/updates/Resolver.groovy#L74-L84

The process added more over the years for maximizing compatibility. That could have become wrong as Gradle evolved and we tried to maintain the behavior, based on our own debugging and the core team’s advice.

For the latest version we do the following, where th current version lookup it is similar except removal of the steps that were not necessary.

  1. To avoid mucking up the build with our modifications, we use copyRecursive(). We used to use a detachedConfiguration but ran into too many Gradle bugs. This is okay except sometimes properties are not copied. I think this might be why we explicitly copy the configuration attributes over.
  2. Change the dependency versions to +, dropping non-external dependencies. As a new dependency is created, we copy the attributes explicitly.
  3. Add dependency constraints as dependencies, if requested as part of the update check.
  4. Try to fix kotlin’s metadata which they dynamically apply in a brittle fashion. If I recall correctly, they hardcoded the lookups to their configuration name so copying broke their assumptions. This caused some metadata like their stdlib injection to be lost. I don’t know why they did not use default dependencies, etc instead which seemed more proper.
  5. Add an Ivy backwards compatibility resolution strategy, as for our Gradle 1.0 this plugin was simply latest.${revision} dynamic lookup. We now recommend using the resolution strategy for controlling the report.
  6. Add the user’s custom resolution strategy for coercing the report’s output
  7. Ignore the hidden default dependencies that users did not declare explicitly (e.g. ant, pmd, jacoco)

I think this is a decent effort without becoming excessively hackish and trying stay to a good citizen, but it has also aged a lot since my original weekend script (old forum). So as usual I’ll repeat my enthusiastic support that someday Gradle build this feature in, which will surely be better than my attempts to fill this void.

1reaction
jwarkentincommented, Apr 5, 2022

Would it be reasonable to make it a warning instead of a failure while investigating possible solutions? This error makes the plugin almost completely unusable for me at the moment. I would be happy with even partial success to find updates for any resolvable dependencies. Also, the version-catalog-update plugin depends on this plugin not erroring out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve error "Failed to resolve: org.jetbrains.kotlin ...
Both IntelliJ and Android Studio currently generate new projects using kotlin-stdlib-jre7 ; this likely is a bug. They have probably not updated ...
Read more >
Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.4.31
Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.4.31 ... PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check ...
Read more >
org.jetbrains.kotlin : kotlin-stdlib-jdk8 - Maven Central
Version Updated OSS Index V: ‎ 1.8.0‑RC Updated: 07‑Dec‑2022 open_in_new V: ‎ 1.7.22 Updated: 28‑Nov‑2022 open_in_new V: ‎ 1.8.0‑Beta Updated: 14‑Nov‑2022 open_in_new
Read more >
org.jetbrains.kotlin » kotlin-stdlib-jdk8 - Maven Repository
Version Vulnerabilities Repository Usages Date 1.8.x 1.8.0‑RC Central 1 Dec 07, 2022 1.8.0‑Beta 1.8.x Central 35 Nov 14, 2022 1.7.x 1.8.x 1.7.22 Central 297 Nov 28,...
Read more >
could not find orgjetbrainskotlinkotlin-stdlib-jdk8 1.3 21
Try to change kotlin-stdlib-jre8 => kotlin-stdlib-jdk8. Kotlin standard library artifacts and split packages. The last version of jre8is 1.2.71 according to ...
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