I get an exception on "gradle eclipse" after updating Gradle to the 2.0 release


(Gunnar Wagenknecht) #1

Sorry if this is an incomplete bug report. I was trying to contribute to Mockito and it’s the first time I’m using Gradle. The thing is, it was working once but then failed (I guess after and brew upgrade, which installed a new Gradle version).

* Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:eclipseClasspath’.

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.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64) Caused by: java.lang.ClassCastException: java.io.File cannot be cast to org.gradle.api.artifacts.Configuration

at org.gradle.plugins.ide.internal.IdeDependenciesExtractor.extractProjectDependencies(IdeDependenciesExtractor.java:52)

at org.gradle.plugins.ide.internal.IdeDependenciesExtractor$extractProjectDependencies$1.call(Unknown Source)

at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory$3.update(ClasspathFactory.groovy:45)

at org.gradle.plugins.ide.eclipse.model.internal.ClasspathEntryBuilder$update$1.call(Unknown Source)

at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory.createEntries(ClasspathFactory.groovy:78)

at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory$createEntries.call(Unknown Source)

at org.gradle.plugins.ide.eclipse.model.EclipseClasspath.resolveDependencies(EclipseClasspath.groovy:209)

at org.gradle.plugins.ide.eclipse.model.EclipseClasspath.mergeXmlClasspath(EclipseClasspath.groovy:216)

at org.gradle.plugins.ide.eclipse.model.EclipseClasspath$mergeXmlClasspath$0.call(Unknown Source)

at org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath.configure(GenerateEclipseClasspath.groovy:44)

at org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath.configure(GenerateEclipseClasspath.groovy)

at org.gradle.plugins.ide.api.XmlGeneratorTask$1.configure(XmlGeneratorTask.java:37)

at org.gradle.plugins.ide.api.XmlGeneratorTask$1.configure(XmlGeneratorTask.java:31)

at org.gradle.plugins.ide.api.GeneratorTask.generate(GeneratorTask.java:78)

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)

… 13 more


(Peter Niederwieser) #2

Most likely the Mockito build hasn’t been updated for 2.0 yet. If available, you should always run Gradle via the repository’s ‘gradlew’ script, not your local Gradle installation. This will make sure that you’ll get the right Gradle version.


(Gunnar Wagenknecht) #3

Thanks! There is such a script and I’ll give it a try.

However, the exception is quite brutal. I suggest to wrap it into a telling error message.