spring-attic / eclipse-integration-gradle

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

Eclipse Gradle error importing Appengine Plugin 1.9.17: java.io.File cannot be cast to org.gradle.api.artifacts.Configuration #79

Closed mrserverless closed 9 years ago

mrserverless 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.

BoykoAlex commented 9 years ago

This seem to come from Gradle Tooling API. It fails to build EclipseProject model. I investigated a bit, created a simple JUnit that uses Gradle Tooling API mostly and still get the same exception… We would have to raise a defect against Gradle Tooling API.

On Jan 6, 2015, at 23:42, Yun Zhi Lin notifications@github.com wrote:

I'm using

OSX Yosemite Java 1.7_55 Eclipse IDE for Java Developers 4.4.1.20140925-1820 Gradle IDE 3.6.3.201411271013-RELEASE When importing the following simple build.gradle from this sample project https://github.com/yunspace/eclipse_gradle_appengine_bug:

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.

— Reply to this email directly or view it on GitHub https://github.com/spring-projects/eclipse-integration-gradle/issues/79.

BoykoAlex commented 9 years ago

I have mirrored your question on Gradle forum: http://forums.gradle.org/gradle/topics/gradle-tooling-api-cannot-build-hierarchicaleclipseproject-model-for-a-project-using-appengine-plugin?rfm=1 http://forums.gradle.org/gradle/topics/gradle-tooling-api-cannot-build-hierarchicaleclipseproject-model-for-a-project-using-appengine-plugin?rfm=1 Might be something wrong on the app engine plugin provider, just as you suspected…

On Jan 7, 2015, at 11:37, Alex Boyko aboyko@pivotal.io wrote:

This seem to come from Gradle Tooling API. It fails to build EclipseProject model. I investigated a bit, created a simple JUnit that uses Gradle Tooling API mostly and still get the same exception… We would have to raise a defect against Gradle Tooling API.

On Jan 6, 2015, at 23:42, Yun Zhi Lin <notifications@github.com mailto:notifications@github.com> wrote:

I'm using

OSX Yosemite Java 1.7_55 Eclipse IDE for Java Developers 4.4.1.20140925-1820 Gradle IDE 3.6.3.201411271013-RELEASE When importing the following simple build.gradle from this sample project https://github.com/yunspace/eclipse_gradle_appengine_bug:

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' 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.

— Reply to this email directly or view it on GitHub https://github.com/spring-projects/eclipse-integration-gradle/issues/79.

BoykoAlex commented 9 years ago

This is the issue with the appengine plugin. Here is the repossess from Gradle core developers: http://forums.gradle.org/gradle/topics/gradle-tooling-api-cannot-build-hierarchicaleclipseproject-model-for-a-project-using-appengine-plugin?utm_source=notification&utm_medium=email&utm_campaign=new_reply&utm_content=reply_button&reply%5Bid%5D=15222186#reply_15222186 http://forums.gradle.org/gradle/topics/gradle-tooling-api-cannot-build-hierarchicaleclipseproject-model-for-a-project-using-appengine-plugin?utm_source=notification&utm_medium=email&utm_campaign=new_reply&utm_content=reply_button&reply[id]=15222186#reply_15222186

Please raise a defect against the appengine plugin vendor. There link to Gurgle app engine GitHub repo is: https://github.com/GoogleCloudPlatform/gradle-appengine-plugin/ https://github.com/GoogleCloudPlatform/gradle-appengine-plugin/

On Jan 7, 2015, at 12:31, Alex Boyko aboyko@pivotal.io wrote:

I have mirrored your question on Gradle forum: http://forums.gradle.org/gradle/topics/gradle-tooling-api-cannot-build-hierarchicaleclipseproject-model-for-a-project-using-appengine-plugin?rfm=1 http://forums.gradle.org/gradle/topics/gradle-tooling-api-cannot-build-hierarchicaleclipseproject-model-for-a-project-using-appengine-plugin?rfm=1 Might be something wrong on the app engine plugin provider, just as you suspected…

On Jan 7, 2015, at 11:37, Alex Boyko <aboyko@pivotal.io mailto:aboyko@pivotal.io> wrote:

This seem to come from Gradle Tooling API. It fails to build EclipseProject model. I investigated a bit, created a simple JUnit that uses Gradle Tooling API mostly and still get the same exception… We would have to raise a defect against Gradle Tooling API.

On Jan 6, 2015, at 23:42, Yun Zhi Lin <notifications@github.com mailto:notifications@github.com> wrote:

I'm using

OSX Yosemite Java 1.7_55 Eclipse IDE for Java Developers 4.4.1.20140925-1820 Gradle IDE 3.6.3.201411271013-RELEASE When importing the following simple build.gradle from this sample project https://github.com/yunspace/eclipse_gradle_appengine_bug:

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' 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.

— Reply to this email directly or view it on GitHub https://github.com/spring-projects/eclipse-integration-gradle/issues/79.

mrserverless commented 9 years ago

Thanks Alex, I've raised an issue with appengine plugin: https://github.com/GoogleCloudPlatform/gradle-appengine-plugin/issues/160