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

bug: Failed to load gradle project. #5732

Open
liurenjie1024 opened this issue Oct 10, 2023 · 2 comments
Open

bug: Failed to load gradle project. #5732

liurenjie1024 opened this issue Oct 10, 2023 · 2 comments
Labels
gradle Gradle related tikets upstream-fix-needed Waiting on a fix upstream

Comments

@liurenjie1024
Copy link

liurenjie1024 commented Oct 10, 2023

Describe the bug

Scala metals failed to load gradle project.

  1. git clone [email protected]:apache/iceberg.git
  2. Open it with vscode metals.
  3. It failed to load project with following error:
2023.10.09 18:43:28 ERROR FAILURE: Build completed with 5 failures.
2023.10.09 18:43:28 ERROR 
2023.10.09 18:43:28 INFO  > Task :iceberg-data:configureBloopInstall
2023.10.09 18:43:28 ERROR 1: Task failed with an exception.
2023.10.09 18:43:28 INFO  > Task :iceberg-arrow:configureBloopInstall
2023.10.09 18:43:28 ERROR -----------
2023.10.09 18:43:28 INFO  > Task :iceberg-nessie:configureBloopInstall
2023.10.09 18:43:28 ERROR * What went wrong:
2023.10.09 18:43:28 INFO  > Task :iceberg-mr:configureBloopInstall
2023.10.09 18:43:28 ERROR Execution failed for task ':iceberg-flink:bloopInstall'.
2023.10.09 18:43:28 INFO  > Task :iceberg-aws:configureBloopInstall
2023.10.09 18:43:28 ERROR > Cannot change dependencies of dependency configuration ':iceberg-flink:testImplementation' after it has been included in dependency resolution.
2023.10.09 18:43:28 INFO  > Task :iceberg-hive-runtime:bloopInstall FAILED
2023.10.09 18:43:28 ERROR 
2023.10.09 18:43:28 ERROR * Try:
2023.10.09 18:43:28 ERROR > Run with --info or --debug option to get more log output.
2023.10.09 18:43:28 ERROR > Run with --scan to get full insights.
2023.10.09 18:43:28 ERROR 
2023.10.09 18:43:28 ERROR * Exception is:
2023.10.09 18:43:28 ERROR org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':iceberg-flink:bloopInstall'.
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:149)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:147)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:135)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
2023.10.09 18:43:28 ERROR 	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
2023.10.09 18:43:28 ERROR 	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:337)
2023.10.09 18:43:28 ERROR 	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:324)
2023.10.09 18:43:28 ERROR 	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:317)
2023.10.09 18:43:28 ERROR 	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
2023.10.09 18:43:28 ERROR 	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
2023.10.09 18:43:28 ERROR 	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
2023.10.09 18:43:28 ERROR Caused by: org.gradle.api.InvalidUserDataException: Cannot change dependencies of dependency configuration ':iceberg-flink:testImplementation' after it has been included in dependency resolution.
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.preventIllegalMutation(DefaultConfiguration.java:1551)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:1510)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$validateMutationType$1(DefaultConfiguration.java:380)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:225)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.DefaultDomainObjectSet.assertMutableCollectionContents(DefaultDomainObjectSet.java:57)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.DefaultDomainObjectCollection.addAllLater(DefaultDomainObjectCollection.java:293)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.DelegatingDomainObjectSet.addAllLater(DelegatingDomainObjectSet.java:105)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyAdder.doAddBundleLazy(DefaultDependencyAdder.java:104)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyAdder.bundle(DefaultDependencyAdder.java:169)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.plugins.jvm.internal.DefaultJvmTestSuite.lambda$new$3(DefaultJvmTestSuite.java:191)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:225)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.runDependencyActions(DefaultConfiguration.java:541)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:714)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:711)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:711)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveExclusively$4(DefaultConfiguration.java:691)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.project.DefaultProjectStateRegistry$CalculatedModelValueImpl.update(DefaultProjectStateRegistry.java:493)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusively(DefaultConfiguration.java:688)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:675)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1800(DefaultConfiguration.java:177)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$VisitedArtifactsSetProvider.getValue(DefaultConfiguration.java:1661)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$VisitedArtifactsSetProvider.getValue(DefaultConfiguration.java:1650)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$SelectedArtifactsProvider.getValue(DefaultConfiguration.java:1697)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$SelectedArtifactsProvider.getValue(DefaultConfiguration.java:1666)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.ResolutionBackedFileCollection.getSelectedArtifacts(ResolutionBackedFileCollection.java:85)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultArtifactCollection.lambda$new$0(DefaultArtifactCollection.java:45)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.model.CalculatedValueContainerFactory$SupplierBackedCalculator.calculateValue(CalculatedValueContainerFactory.java:65)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.model.CalculatedValueContainer$CalculationState.lambda$attachValue$0(CalculatedValueContainer.java:229)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.Try.ofFailable(Try.java:41)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.model.CalculatedValueContainer$CalculationState.attachValue(CalculatedValueContainer.java:224)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.model.CalculatedValueContainer.finalizeIfNotAlready(CalculatedValueContainer.java:197)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.model.CalculatedValueContainer.finalizeIfNotAlready(CalculatedValueContainer.java:188)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultArtifactCollection.ensureResolved(DefaultArtifactCollection.java:102)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.artifacts.configurations.DefaultArtifactCollection.iterator(DefaultArtifactCollection.java:85)
2023.10.09 18:43:28 ERROR 	at scala.collection.convert.Wrappers$JIterableWrapper.iterator(Wrappers.scala:60)
2023.10.09 18:43:28 ERROR 	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
2023.10.09 18:43:28 ERROR 	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
2023.10.09 18:43:28 ERROR 	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
2023.10.09 18:43:28 ERROR 	at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:62)
2023.10.09 18:43:28 ERROR 	at scala.collection.generic.Growable.$plus$plus$eq$(Growable.scala:53)
2023.10.09 18:43:28 ERROR 	at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:184)
2023.10.09 18:43:28 ERROR 	at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:47)
2023.10.09 18:43:28 ERROR 	at scala.collection.TraversableLike.to(TraversableLike.scala:786)
2023.10.09 18:43:28 ERROR 	at scala.collection.TraversableLike.to$(TraversableLike.scala:783)
2023.10.09 18:43:28 ERROR 	at scala.collection.AbstractTraversable.to(Traversable.scala:108)
2023.10.09 18:43:28 ERROR 	at scala.collection.TraversableOnce.toList(TraversableOnce.scala:350)
2023.10.09 18:43:28 ERROR 	at scala.collection.TraversableOnce.toList$(TraversableOnce.scala:350)
2023.10.09 18:43:28 ERROR 	at scala.collection.AbstractTraversable.toList(Traversable.scala:108)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.model.BloopConverter.getConfigurationArtifacts(BloopConverter.scala:435)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.model.BloopConverter.$anonfun$toBloopConfig$24(BloopConverter.scala:367)
2023.10.09 18:43:28 ERROR 	at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
2023.10.09 18:43:28 ERROR 	at scala.collection.Iterator.foreach(Iterator.scala:943)
2023.10.09 18:43:28 ERROR 	at scala.collection.Iterator.foreach$(Iterator.scala:943)
2023.10.09 18:43:28 ERROR 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
2023.10.09 18:43:28 ERROR 	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
2023.10.09 18:43:28 ERROR 	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
2023.10.09 18:43:28 ERROR 	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
2023.10.09 18:43:28 ERROR 	at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
2023.10.09 18:43:28 ERROR 	at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
2023.10.09 18:43:28 ERROR 	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.model.BloopConverter.toBloopConfig(BloopConverter.scala:367)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.tasks.ScalaJavaInstall$.generateBloopConfiguration(BloopInstallTask.scala:104)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.tasks.ScalaJavaInstall$.$anonfun$install$1(BloopInstallTask.scala:88)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.tasks.ScalaJavaInstall$.$anonfun$install$1$adapted(BloopInstallTask.scala:80)
2023.10.09 18:43:28 ERROR 	at scala.collection.immutable.Set$Set2.foreach(Set.scala:181)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.tasks.ScalaJavaInstall$.install(BloopInstallTask.scala:80)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.tasks.BloopInstallTask.runBloopPlugin(BloopInstallTask.scala:65)
2023.10.09 18:43:28 ERROR 	at bloop.integrations.gradle.tasks.BloopInstallTask.run(BloopInstallTask.scala:41)
2023.10.09 18:43:28 ERROR 	at jdk.internal.reflect.GeneratedMethodAccessor778.invoke(Unknown Source)
2023.10.09 18:43:28 ERROR 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2023.10.09 18:43:28 ERROR 	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
2023.10.09 18:43:28 ERROR 	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)

Expected behavior

I tried vscode's plugin: Extension Pack for Java, which can load project successfully, I assume metals will also works.

Operating system

Linux

Editor/Extension

VsCode

Version of Metals

1.25.0

Extra context or search terms

gradle
org.gradle.api.InvalidUserDataException: Cannot change dependencies of dependency configuration

@tgodzik
Copy link
Contributor

tgodzik commented Oct 10, 2023

Thanks for reporting, this looks like an issue with our gradle plugin, I opened up an issue in there scalacenter/gradle-bloop#70

You can also try setting things up manually https://scalameta.org/metals/docs/build-tools/gradle#manual-installation

@liurenjie1024
Copy link
Author

Hi, thanks for reply. I followed the steps here, but it still reports error:

* What went wrong:
Execution failed for task ':iceberg-flink:bloopInstall'.
> Cannot change dependencies of dependency configuration ':iceberg-flink:testImplementation' after it has been included in dependency resolution.

@tgodzik tgodzik added upstream-fix-needed Waiting on a fix upstream gradle Gradle related tikets labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gradle Gradle related tikets upstream-fix-needed Waiting on a fix upstream
Projects
None yet
Development

No branches or pull requests

2 participants