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

Failures and warnings with Gradle 6.8-milestone-1 #432

Closed
juergenzimmermann opened this issue Oct 19, 2020 · 22 comments
Closed

Failures and warnings with Gradle 6.8-milestone-1 #432

juergenzimmermann opened this issue Oct 19, 2020 · 22 comments

Comments

@juergenzimmermann
Copy link

When using Gradle 6.8-milestone-1 I get the following warnings for gradle dependencyUpdates:

$ gradle dependencyUpdates

> Task :dependencyUpdates
Failed to resolve ::-api
Failed to resolve ::-runtime
Failed to resolve ::api
Failed to resolve ::apiElements
The archives configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0. Please resolve the compileClasspath or runtimeClasspath configuration instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.8-milestone-1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
Failed to resolve ::bootArchives
The compile configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0. Please resolve the compileClasspath configuration instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.8-milestone-1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
The default configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0. Please resolve the compileClasspath or runtimeClasspath configuration instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.8-milestone-1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
Failed to resolve ::implementation
The runtime configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0. Please resolve the runtimeClasspath configuration instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.8-milestone-1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
Failed to resolve ::runtimeElements
Failed to resolve ::runtimeOnly
Failed to resolve ::sourceArtifacts
Failed to resolve ::testApi
The testCompile configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0. Please resolve the testCompileClasspath configuration instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.8-milestone-1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
Failed to resolve ::testImplementation
The testRuntime configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0. Please resolve the testRuntimeClasspath configuration instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.8-milestone-1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
Failed to resolve ::testRuntimeOnly
@ben-manes
Copy link
Owner

I do not see a 6.8 release candidate, so I used the nightly snapshot (6.8-20201018220038+0000). I didn't see any warnings in my local projects. You can use --warning-mode=all to see the source of these deprecations or --info tot see more details on the failures (often some stacktrace). Please also ensure that you are using our latest plugin version.

@juergenzimmermann
Copy link
Author

I'm using com.github.ben-manes.versions 0.33.0 withorg.gradle.warning.mode = all in gradle.properties.
Gradle 6.8-milestone-1 is available at https://services.gradle.org/distributions .
Here is the (shortened) output of gradle dependencyUpdates --info:

...
> Task :dependencyUpdates
Caching disabled for task ':dependencyUpdates' because:
  Caching has not been enabled for the task
Task ':dependencyUpdates' is not up-to-date because:
  Task.upToDateWhen is false.
Resolving kunde project (root) buildscript with repositories:
 - __plugin_repository__Gradle Central Plugin Repository: PluginArtifactRepository
 - __plugin_repository__MavenRepo: PluginArtifactRepository
 - __plugin_repository__maven: PluginArtifactRepository
 - __plugin_repository__maven2: PluginArtifactRepository
 - __plugin_repository__maven3: PluginArtifactRepository
Resolving kunde project (root) configurations with repositories:
 - MavenRepo: https://repo.maven.apache.org/maven2/
 - maven: https://dl.bintray.com/kotlin/kotlin-eap
 - maven2: https://repo.spring.io/milestone
 - maven3: https://repo.spring.io/release
 - BintrayJCenter: https://jcenter.bintray.com/
Failed to resolve ::-api
java.lang.IllegalStateException: Resolving dependency configuration '-api' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends '-api' should be resolved.
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.assertIsResolvable(DefaultConfiguration.java:1343)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:556)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:552)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
        at org.springframework.boot.gradle.tasks.bundling.ResolvedDependencies.processConfiguration(ResolvedDependencies.java:53)
        at org.springframework.boot.gradle.tasks.bundling.BootJar.lambda$null$0(BootJar.java:82)
        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:100)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:95)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:83)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
        at com.sun.proxy.$Proxy37.afterResolve(Unknown Source)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:636)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:613)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:613)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveExclusively$4(DefaultConfiguration.java:593)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$CalculatedModelValueImpl.update(DefaultProjectStateRegistry.java:361)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusively(DefaultConfiguration.java:590)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:577)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:552)
        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.GeneratedMethodAccessor55.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: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)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:502)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:487)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:470)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$400(ExecuteActionsTaskExecuter.java:104)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:270)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:248)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$executeOperation$1(ExecuteStep.java:67)
        at java.base/java.util.Optional.orElseGet(Optional.java:362)
        at org.gradle.internal.execution.steps.ExecuteStep.executeOperation(ExecuteStep.java:67)
        at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:34)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:48)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:45)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:34)
        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:53)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:38)
        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.CreateOutputsStep.execute(CreateOutputsStep.java:42)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:30)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:65)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:46)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:47)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:26)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:172)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:74)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:45)
        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:103)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:96)
        at java.base/java.util.Optional.map(Optional.java:258)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:56)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:81)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:41)
        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:96)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:51)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:87)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:58)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:89)
        at java.base/java.util.Optional.orElseGet(Optional.java:362)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:89)
        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:46)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:33)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:41)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.withWorkspace(ExecuteActionsTaskExecuter.java:287)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:41)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:31)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:41)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:31)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:54)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:40)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:41)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:180)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:172)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:377)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:364)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:357)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:343)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.base/java.lang.Thread.run(Thread.java:832)
...

@ben-manes
Copy link
Owner

The canBeResolved is flag is honored, but their matrix is fairly confusing given that many configurations require resolution but are marked as not supposed to be. Sometimes due to legacy or due to platform plugins that do not set their configurations correctly. We'd need a project to test against, if you wanted to provide a set of build files that can be run.

def isUsefulConfiguration = !config.canBeResolved || config.canBeConsumed ||
config.name == 'annotationProcessor' || config.name == 'kapt'
if (isUsefulConfiguration) {
resolve(resolver, proj, config)

@schnapster
Copy link

Shouldn't that be config.canBeResolved instead of !config.canBeResolved?

@ben-manes
Copy link
Owner

Gradle's descriptions are confusing so I'm not sure, tbh

Configuration role can be resolved can be consumed
Bucket of dependencies false false
Resolve for certain usage true false
Exposed to consumers false true
Legacy, don’t use true true

@schnapster
Copy link

I have a project using Gradle 6.6.1, versions plugin 0.31.0, and Spring Boot (plugin) 2.4.0-M3 (amongst many other plugins and dependencies). I started updating its dependencies, and somewhere in the middle noticed lots of dependencies missing, and instead seeing those Failed to resolve ::XXX messages. So I reverted, and started changing versions one-by-one to find the culprit. Turns out: As soon as I bump the Spring Boot version to 2.4.0-M4, the resolution starts failing.

Downgrading back to Gradle 6.6.1 doesn't fix it.
Version Plugin v 0.27.0, 0.33.0 have the issue as well.

Unfortunately I cannot share the source, but I'll try to see if I can get a minimal example working.

@schnapster
Copy link

Here's a minimal project and step-by-step guide to reproduce this issue: https://github.com/napstr/gradle-versions-rip

@ben-manes
Copy link
Owner

Thanks @napstr. Unfortunately, I won't be able to look at this soon as my workend is already committed, so at best would be next week to try to help.

As you figured out, the error via --info is regarding this setting,

java.lang.IllegalStateException: Resolving dependency configuration 'testImplementation' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'testImplementation' should be resolved.

You could try modifying that filtering code in DependencyUpdates based on this error and the documentation. By using gradlew install the plugin will be in your local m2 repository. It can then be used via a mavenLocal() repository to let you iterate until the plugin passes. Maybe that will offer us some insight and, if we determine it can be changed safely, then we can release the modifications.

@ben-manes
Copy link
Owner

A quick look and their configuration settings haven't changed between versions.

configurations.each {
  println "${it.name}: canBeResolved=${it.canBeResolved}, canBeConsumed=${it.canBeConsumed}"
}

That makes sense since some of those configurations are Gradle's. I'm not sure what the M4 plugin is doing differently to make the configurations become incompatible.

@schnapster
Copy link

schnapster commented Oct 22, 2020

Thanks for the instructions to test local builds of the plugin!
This is by no means urgent from my side.
I'll see what I can accomplish during my "workend" :)

@ben-manes
Copy link
Owner

hah, I didn't mean to use that slang but was tired, and mistyped it like that 😆

I took a quick peek and the cause seems to be this Spring commit. It sets the base Java configurations to extend Spring's own. Presumably when the child configuration is resolved it has to resolve its parent's and causes the failure. When we ensure that the child's copy is set to allow resolution (code), that must not override the parent and you see these failures.

I'm not super confident on how we should treat canBeResolved and canBeConsumed. The explicit setting was used for backwards compatibility across older versions, when this change was incubating.

@wilkinsona is a lot sharper than I am and maybe can advise on how to improve our usage.

@wilkinsona
Copy link

wilkinsona commented Oct 23, 2020

That commit in Spring Boot is configuring Spring Boot's own build (all the code lives in buildSrc) so no one else should be affected by it. I'll see if I can find some time to dig a bit and spot what change we made in the public plugin that's triggered the change in behaviour in M4. Thanks for the ping, @ben-manes.

@ben-manes
Copy link
Owner

ben-manes commented Oct 23, 2020

@wilkinsona oh, I might simply be wrong in my investigation so far. I was just about to post this bit which may be wrong,


Snuck in a little more time, and I don't think that I can solve this programmatically.

Spring's dependencyManagement configuration is invisible (via setVisible(false)) so it does not appear through the APIs. I had hoped to be able to evaluate the parent configurations and test them, thereby filtering out the configuration from being resolved. Unfortunately since the APIs do not result dependencyManagement as a parent, there is no way to detect its status and skip it.

@christiangoudreau
Copy link

I confirm, reverting spring boot plugin to id 'org.springframework.boot' version '2.4.0-M3' fixes the resolution problem.

I hope they fixes this soon. Is there anything that could be done on your plugin side?

@ben-manes
Copy link
Owner

I think we need some details from @wilkinsona about the changes between releases, at which point we can being theorizing about where the fix should go and what that might be. At the moment I do not know.

@wilkinsona
Copy link

The change in behaviour in Boot's plugin is due to this commit. The TL;DR of those changes is that we register an afterResolve action on each configuration's ResolvableDependencies and when the action is invoked we call getResolvedConfiguration() on the configuration and it fails. For reasons that I can't explain at the moment, it would appear that the afterResolve action is being called for a configuration that has, in fact, not been resolved.

@wilkinsona
Copy link

I imagine that the behaviour could be worked around by checking that the configuration is actually resolved before processing it:

getProject().getConfigurations().all((configuration) -> {
	ResolvableDependencies incoming = configuration.getIncoming();
	incoming.afterResolve((resolvableDependencies) -> {
		if (configuration.getState() == State.RESOLVED) {
			this.resolvedDependencies.processConfiguration(configuration);
		}
	});
});

I'm reluctant to make that change right now as the state check looks unnecessary. It would be at risk of being removed in the future by someone tidying things up. To avoid that, we'd need to add a test that reproduces the problem but I can't do that without understanding exactly what's causing the problem.

@wilkinsona
Copy link

I guess it's the copying of the configuration that's causing the problem. I have a vague recollection that this has caused problems in the past. Assuming that after resolve callbacks are included in the copy, the callback above will be getting called when the made-resolvable copy is resolved but is then, presumably, triggering processing of the original unresolvable configuration.

@ben-manes
Copy link
Owner

Thanks @wilkinsona. It does sound like our using Configuration#copyRecursive interacts with your logic (as that has bitten compatibility in the past with Spring). It doesn't sound like there's anything we can do in this plugin to assist here, just confusion within Gradle's lifecycle wrt copying that unfortunately you'll likely have to work around.

@wilkinsona
Copy link

I've opened spring-projects/spring-boot#24072.

@juergenzimmermann
Copy link
Author

@ben-manes The issue is gone after upgrading to the fresh released Spring Boot 2.4.0.

@ben-manes
Copy link
Owner

Thank you for the update @juergenzimmermann. And thank you @wilkinsona for being so helpful and fixing this promptly.

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

5 participants