Eclipse import fails (Gradle 3.1, Eclipse 4.6.1, BuildShip 2.0, Java 8)

issue-resolved
buildship
eclipse
not-a-bug

(Dejan Stojadinović) #1

Gradle Version: 3.1
Operating System and JVM version: Win 10 64 bit, JVM: Oracle 1.8
Is this a regression? If yes, which version of Gradle do you know it last worked for? Yes, it is. Import works for Gradle version 3.0

Eclipse version: Neon.1 (4.6.1-RC4) build id: M20160907-1200

Buildship version: 2.0.0.v20160609-0958-m

Reported also here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=501732 Gradle project import fails (Buildship 2.0, Gradle 3.1, Eclipse 4.6.1, Java 8)

org.gradle.tooling.UnsupportedVersionException: The version of Gradle you are using (3.1) does not support the CompositeModelBuilder API. Support for this is available in Gradle 2.13 and all later versions.
at org.gradle.tooling.model.internal.Exceptions.unsupportedFeature(Exceptions.java:72)
at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.buildModels(AbstractConsumerConnection.java:73)
at org.gradle.tooling.internal.connection.DefaultCompositeModelBuilder$1.run(DefaultCompositeModelBuilder.java:92)
at org.gradle.tooling.internal.connection.DefaultCompositeModelBuilder$1.run(DefaultCompositeModelBuilder.java:86)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:79)
at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
at org.gradle.tooling.internal.connection.DefaultCompositeModelBuilder.get(DefaultCompositeModelBuilder.java:74)
at org.gradle.tooling.internal.connection.DefaultCompositeModelBuilder.get(DefaultCompositeModelBuilder.java:40)
at com.gradleware.tooling.toolingclient.internal.deduplication.DelegatingModelBuilder.get(DelegatingModelBuilder.java:141)
at com.gradleware.tooling.toolingclient.internal.deduplication.DeduplicatingGradleConnection$DeduplicatingEclipseModelBuilder.get(DeduplicatingGradleConnection.java:93)
at com.gradleware.tooling.toolingclient.internal.deduplication.DeduplicatingGradleConnection$DeduplicatingEclipseModelBuilder.get(DeduplicatingGradleConnection.java:85)
at com.gradleware.tooling.toolingclient.internal.DefaultToolingClient.executeAndWait(DefaultToolingClient.java:210)
at com.gradleware.tooling.toolingclient.internal.DefaultCompositeBuildModelRequest.executeAndWait(DefaultCompositeBuildModelRequest.java:47)
at com.gradleware.tooling.toolingclient.internal.DefaultCompositeBuildModelRequest.executeAndWait(DefaultCompositeBuildModelRequest.java:31)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository$1.get(BaseModelRepository.java:95)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeAndWait(BaseModelRepository.java:163)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.access$000(BaseModelRepository.java:41)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository$2.call(BaseModelRepository.java:121)
at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4724)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4721)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.getFromCache(BaseModelRepository.java:138)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeRequest(BaseModelRepository.java:117)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeRequest(BaseModelRepository.java:88)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultCompositeModelRepository.executeRequest(DefaultCompositeModelRepository.java:99)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultCompositeModelRepository.fetchEclipseProjects(DefaultCompositeModelRepository.java:63)
at org.eclipse.buildship.core.workspace.internal.DefaultCompositeModelprovider.fetchEclipseProjects(DefaultCompositeModelprovider.java:39)
at org.eclipse.buildship.core.workspace.internal.SynchronizeCompositeBuildJob.fetchEclipseProjects(SynchronizeCompositeBuildJob.java:72)
at org.eclipse.buildship.core.workspace.internal.SynchronizeCompositeBuildJob.runToolingApiJob(SynchronizeCompositeBuildJob.java:65)
at org.eclipse.buildship.core.util.progress.ToolingApiJob$1.run(ToolingApiJob.java:73)
at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(ToolingApiInvoker.java:63)
at org.eclipse.buildship.core.util.progress.ToolingApiJob.run(ToolingApiJob.java:70)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Exciting new Buildship Features coming up
(Dejan Stojadinović) #2

Example project: https://github.com/dejan2609/gradle-simple

  • tag GRADLE-3.0 -->> Eclipse import works
  • tag GRADLE-3.1 -->> Eclipse import fails

(Donát Csikós) #3

Hi Dejan,

I see you are using a Buildship 2.x snapshot which is the work-in-progress version for the composite build support. The 2.x Buildship branch still uses an incubating Gradle API to access build configuration which was removed in Gradle 3.1. This will be fixed once the new API is in place.

In the meanwhile I suggest to use the stable 1.x releases. I’ll update this thread once we fixed this issue.


(Aaron Madlon-Kay) #4

I get a very similar error with Buildship v1.0.20 (if I recall correctly; I’m not at my computer right now) and Gradle 3.1 but not with Gradle 3.0.


(Donát Csikós) #5

1.0.20 works for me.


(Dejan Stojadinović) #6

Tested moments ago (Buildship v1.0.20/Gradle 3.1): works as expected (using POC project https://github.com/dejan2609/gradle-simple)


(Aaron Madlon-Kay) #7

OK, I take it back. The error I was seeing appears to be just some stale state; it’s gone after restarting Eclipse.

Sorry for the false alarm.


(Donát Csikós) #8

Hi!

I just want to let you know, that this problem has been fixed in the latest 2.0 snapshot build.