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

checkUnusedConstraints fails in gradle 8 #1027

Open
robert3005 opened this issue Feb 21, 2023 · 0 comments
Open

checkUnusedConstraints fails in gradle 8 #1027

robert3005 opened this issue Feb 21, 2023 · 0 comments

Comments

@robert3005
Copy link
Contributor

What happened?

Caused by: org.gradle.api.InvalidUserDataException: Cannot change dependencies of dependency configuration ':test-api:testImplementation' after it has been included in dependency resolution.
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.preventIllegalMutation(DefaultConfiguration.java:1446)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:1405)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$validateMutationType$1(DefaultConfiguration.java:332)
        at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:225)
        at org.gradle.api.internal.DefaultDomainObjectSet.assertMutableCollectionContents(DefaultDomainObjectSet.java:57)
        at org.gradle.api.internal.DefaultDomainObjectCollection.addAllLater(DefaultDomainObjectCollection.java:293)
        at org.gradle.api.internal.DelegatingDomainObjectSet.addAllLater(DelegatingDomainObjectSet.java:105)
        at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyAdder.doAddBundleLazy(DefaultDependencyAdder.java:104)
        at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyAdder.bundle(DefaultDependencyAdder.java:169)
        at org.gradle.api.plugins.jvm.internal.DefaultJvmTestSuite.lambda$new$3(DefaultJvmTestSuite.java:191)
        at org.gradle.internal.ImmutableActionSet$SetWithFewActions.execute(ImmutableActionSet.java:285)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.runDependencyActions(DefaultConfiguration.java:493)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.runDependencyActions(DefaultConfiguration.java:500)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:663)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:660)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:660)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveExclusively$4(DefaultConfiguration.java:640)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$CalculatedModelValueImpl.update(DefaultProjectStateRegistry.java:486)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusively(DefaultConfiguration.java:637)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveToStateOrLater$3(DefaultConfiguration.java:621)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$fromMutableState$1(DefaultProjectStateRegistry.java:411)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withReplacedLocks(DefaultWorkerLeaseService.java:345)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:411)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:621)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1900(DefaultConfiguration.java:166)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationResolvableDependencies$LenientResolutionResult.resolve(DefaultConfiguration.java:2007)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationResolvableDependencies$LenientResolutionResult.getAllComponents(DefaultConfiguration.java:2049)
        at com.palantir.gradle.versions.CheckUnusedConstraintsTask.lambda$getResolvedModuleIdentifiers$7(CheckUnusedConstraintsTask.java:171)
        ... 103 more

What did you want to happen?

Task should run without throwing exception

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

1 participant