jvm-dependency-conflict-resolution
jvm-dependency-conflict-resolution copied to clipboard
Invalid Variant Selection When Preparing Build Scan
The build succeeds, but the build scan fails with the following error:
A build scan cannot be produced as an error occurred gathering build data. Please report this problem via https://gradle.com/help and include the following via copy/paste:
Gradle version: 7.6.4
Plugin version: 3.18.2
com.gradle.scan.plugin.internal.operations.a: Build operation dispatch of finished notification failed.
Operation context:
org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$1 (16880): {}
org.gradle.execution.RunRootBuildWorkBuildOperationType$Details (33124): {getBuildStartTime=1747359390369}
org.gradle.api.internal.tasks.execution.ExecuteTaskBuildOperationDetails (33142): {buildPath=:, taskPath=:vault-model:graphViewMain, taskClass=com.autonomousapps.tasks.GraphViewTask, taskId=5276}
org.gradle.api.internal.tasks.execution.TaskExecution$1 (33143): {}
org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep$Operation$Details$1 (33144): {}
org.gradle.api.internal.artifacts.configurations.ResolveConfigurationResolutionBuildOperationDetails (33146): {describe error: java.lang.IllegalAccessException: class com.gradle.scan.plugin.internal.operations.a cannot access a member of class org.gradle.api.internal.artifacts.configurations.ResolveConfigurationResolutionBuildOperationDetails with modifiers "public"}
org.gradle.api.internal.artifacts.configurations.ResolveConfigurationResolutionBuildOperationDetails (33147): {describe error: java.lang.IllegalAccessException: class com.gradle.scan.plugin.internal.operations.a cannot access a member of class org.gradle.api.internal.artifacts.configurations.ResolveConfigurationResolutionBuildOperationDetails with modifiers "public"}
Caused by: org.gradle.api.InvalidUserCodeException: Variant 'runtime' doesn't belong to resolved component 'org.springframework:spring-jcl:6.1.19'. There's no resolved variant with the same name. Most likely you are using a variant from another component to get the dependencies of this component.
at org.gradle.api.internal.artifacts.result.DefaultResolvedComponentResult.reportInvalidVariant(DefaultResolvedComponentResult.java:152)
at org.gradle.api.internal.artifacts.result.DefaultResolvedComponentResult.getDependenciesForVariant(DefaultResolvedComponentResult.java:140)
at com.gradle.scan.plugin.internal.c.i.a.j.a(SourceFile:36)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:150)
at com.gradle.scan.plugin.internal.f.b.a(SourceFile:26)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:126)
at com.gradle.scan.plugin.internal.c.i.a.e$a.a(SourceFile:105)
at com.gradle.scan.plugin.internal.c.i.a.e$a.
While digging into this, I found when I added a direct dependency that was previously being pulled in transitively (ie spring-core), then the error appears. When I comment out this dependency, the scan succeeds. Both spring-core and spring-dcl are the same version. I'm still puzzled why Gradle attempts to get dependencies from the non-existent 'runtime' variant of spring-dcl when it should be getting dependencies from the 'runtimeElements' variant.
Also, spring-dcl is NOT a direct dependency of this build. However, the jvm-dependency-conflict-resolution plugin is configured to select spring-dcl as the capability for org.gradlex:commons-logging-impl. I am using version 2.2 of the jvm-dependency-conflict-resolution plugin.
@jwise-sncr it is hard to tell what is going on. Especially because of the obfuscated stack trace. If the build succeeds otherwise and you only get an error when attempting to publish a build scan, it is likely an issue with the build scan plugin in Gradle and not the jvm-dependency-conflict-resolution. You may consider to open an issue directly at https://github.com/gradle/gradle/issues.
Still, the rules added by the plugin may somehow trigger this. Can you please share a reproducer? Then we can take a look.