Applying the JDepend plugin causes "gradle tasks" to fail with "Could not determine the dependencies of task ':jdependTest'."


(Baron Roberts) #1

It appears that the JDepend plugin is being too eager to resolve its dependencies. When attempting to run the “tasks” task with the JDepend plugin applied, gradle dies with “Could not determine the dependencies of task ‘:jdependTest’.”. The stack trace is:

  org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:tasks’.

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)

at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)

at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)

at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)

at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)

at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)

at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)

at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)

at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:296)

at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)

at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)

at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)

at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)

at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)

at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)

at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)

at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)

at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:148)

at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:105)

at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:85)

at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:81)

at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)

at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:39)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)

at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)

at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)

at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)

at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)

at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)

at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)

at org.gradle.launcher.Main.doAction(Main.java:33)

at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)

at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)

at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)

at org.gradle.launcher.GradleMain.main(GradleMain.java:23) Caused by: org.gradle.api.GradleException: Could not determine the dependencies of task ‘:jdependTest’.

at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:65)

at org.gradle.api.internal.tasks.AbstractTaskDependency.getDependencies(AbstractTaskDependency.java:27)

at org.gradle.api.internal.tasks.DefaultTaskContainer$1.getNodeValues(DefaultTaskContainer.java:178)

at org.gradle.api.internal.tasks.DefaultTaskContainer$1.getNodeValues(DefaultTaskContainer.java:176)

at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:200)

at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:112)

at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:64)

at org.gradle.api.internal.tasks.DefaultTaskContainer.actualize(DefaultTaskContainer.java:176)

at org.gradle.api.internal.project.DefaultProjectTaskLister.listProjectTasks(DefaultProjectTaskLister.java:30)

at org.gradle.api.tasks.diagnostics.TaskReportTask.generate(TaskReportTask.java:61)

at org.gradle.api.tasks.diagnostics.AbstractReportTask.generate(AbstractReportTask.java:73)

at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)

at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:570)

at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:553)

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)

… 44 more Caused by: org.gradle.api.InvalidUserDataException: You can’t change configuration ‘jdepend’ because it is already resolved!

at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.throwExceptionIfNotInUnresolvedState(DefaultConfiguration.java:388)

at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$400(DefaultConfiguration.java:45)

at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$VetoContainerChangeAction.run(DefaultConfiguration.java:488)

at org.gradle.api.internal.DefaultDomainObjectCollection.assertMutable(DefaultDomainObjectCollection.java:258)

at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:158)

at org.gradle.api.internal.DelegatingDomainObjectSet.add(DelegatingDomainObjectSet.java:80)

at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.doAdd(DefaultDependencyHandler.java:81)

at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.methodMissing(DefaultDependencyHandler.java:116)

at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:225)

at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:129)

at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:163)

at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated.invokeMethod(Unknown Source)

at org.gradle.api.plugins.quality.JDependPlugin$_configureTaskDefaults_closure2_closure6_closure7.doCall(JDependPlugin.groovy:66)

at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)

at org.gradle.api.internal.project.AbstractProject.dependencies(AbstractProject.java:804)

at org.gradle.api.Project$dependencies$13.call(Unknown Source)

at org.gradle.api.plugins.quality.JDependPlugin$_configureTaskDefaults_closure2_closure6.doCall(JDependPlugin.groovy:65)

at org.gradle.api.internal.ConventionAwareHelper$1.getValue(ConventionAwareHelper.java:72)

at org.gradle.api.internal.ConventionAwareHelper$MappedPropertyImpl.getValue(ConventionAwareHelper.java:136)

at org.gradle.api.internal.ConventionAwareHelper.getConventionValue(ConventionAwareHelper.java:114)

at org.gradle.api.plugins.quality.JDepend_Decorated.getJdependClasspath(Unknown Source)

at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo$4.create(AnnotationProcessingTaskFactory.java:452)

at org.gradle.util.SingleMessageLogger.whileDisabled(SingleMessageLogger.java:160)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo.getValue(AnnotationProcessingTaskFactory.java:450)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$Validator$1.call(AnnotationProcessingTaskFactory.java:254)

at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:120)

at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75)

at org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext$BuildableFileTreeInternalConverter.convertInto(BuildDependenciesOnlyFileCollectionResolveContext.java:50)

at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:98)

at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileCollections(DefaultFileCollectionResolveContext.java:82)

at org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext.resolveAsBuildables(BuildDependenciesOnlyFileCollectionResolveContext.java:43)

at org.gradle.api.internal.file.CompositeFileCollection.addDependencies(CompositeFileCollection.java:136)

at org.gradle.api.internal.file.CompositeFileCollection$3.resolve(CompositeFileCollection.java:124)

at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:86)

at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:200)

at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:112)

at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:64)

at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.doResolve(CachingTaskDependencyResolveContext.java:74)

at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:63)

… 62 more


(Baron Roberts) #2

Found the bug in Gradle’s JDependPlugin and submitted pull request #312.