spring-attic / eclipse-integration-gradle

Gradle Tooling for Eclipse
Eclipse Public License 1.0
298 stars 108 forks source link

Eclipse Gradle error with Appengine plugin 1.9.17: java.io.File cannot be cast to org.gradle.api.artifacts.Configuration #77

Closed trunkbot closed 9 years ago

trunkbot commented 9 years ago

I'm using

When importing the following simple build.gradle from this sample project:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.appengine:gradle-appengine-plugin:1.9.17'
    }
}
apply plugin: 'war'
apply plugin: 'appengine'
apply plugin: 'java'

sourceCompatibility = 1.7
version = '1.0'

repositories {
    jcenter()
}

dependencies {
    appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.17'
    testCompile group: 'junit', name: 'junit', version: '4.11'
}

appengine {
    downloadSdk = true
}

I get the following error:

!ENTRY org.springsource.ide.eclipse.gradle.core 4 0 2015-01-07 15:17:25.270
!MESSAGE java.io.File cannot be cast to org.gradle.api.artifacts.Configuration
!STACK 0
java.lang.reflect.InvocationTargetException
at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:112)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Caused by: org.eclipse.core.runtime.CoreException: java.io.File cannot be cast to org.gradle.api.artifacts.Configuration
at org.springsource.ide.eclipse.gradle.core.util.ExceptionUtil.coreException(ExceptionUtil.java:42)
at org.springsource.ide.eclipse.gradle.core.util.ExceptionUtil.coreException(ExceptionUtil.java:53)
at org.springsource.ide.eclipse.gradle.core.modelmanager.BuildResult.get(BuildResult.java:85)
at  org.springsource.ide.eclipse.gradle.core.modelmanager.GradleProjectModelManager.getModelInternal(GradleProjectModelManager.java:145)
at org.springsource.ide.eclipse.gradle.core.modelmanager.GradleProjectModelManager.getModel(GradleProjectModelManager.java:100)
at org.springsource.ide.eclipse.gradle.core.modelmanager.GradleModelManager.getModel(GradleModelManager.java:77)
at org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:608)
at org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(GradleImportWizardPageOne.java:516)
at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:104)
... 1 more

Caused by: org.gradle.tooling.GradleConnectionException: Could not fetch model of type 'HierarchicalEclipseProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.1-bin.zip'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
at org.gradle.tooling.internal.consumer.DefaultModelBuilder.get(DefaultModelBuilder.java:48)
at org.springsource.ide.eclipse.gradle.core.modelmanager.ToolinApiUtils.buildModel(ToolinApiUtils.java:103)
at org.springsource.ide.eclipse.gradle.core.modelmanager.DefaultModelBuilder.doBuild(DefaultModelBuilder.java:30)
at org.springsource.ide.eclipse.gradle.core.modelmanager.AbstractModelBuilder.buildModel(AbstractModelBuilder.java:40)
at org.springsource.ide.eclipse.gradle.core.modelmanager.HierarchicalProjectBuildStrategy.buildReferenceModel(HierarchicalProjectBuildStrategy.java:179)
at org.springsource.ide.eclipse.gradle.core.modelmanager.HierarchicalProjectBuildStrategy.buildModels(HierarchicalProjectBuildStrategy.java:65)
at org.springsource.ide.eclipse.gradle.core.modelmanager.GradleProjectModelManager.getModelInternal(GradleProjectModelManager.java:141)
... 6 more

This project runs correctly via command line and imports fine in IntelliJ. I have narrowed down the issue to appengine gradle plugin 1.9.17. Please verify if this is an issue on the Eclipse Gradle integration side in importing the plugin, or should I raise an issue with the plugin provider.

trunkbot commented 9 years ago

Sorry for the duplication, move this issue to #79 under my personal account.