Cycle detected when setting up gradle's own source in eclipse

I did a ‘git pull’ on the gradle source, ran ‘./gradlew cleanEclipse eclipse’ and then imported all the items in subprojects into eclipse. Eclipse hangs for a long time in “refreshing workspace”, but eventually finishes with many errors like this one. Is the a problem with viewing/editing gradle’s source code in eclipse, or a problem with the eclipse plugin?

Description Resource Path Location Type A cycle was detected in the build path of project ‘core’. The cycle consists of projects {core, native, announce, internalTesting, baseServices, coreImpl, internalIntegTesting, launcher, ui, openApi, toolingApi, wrapper, ide, scala, plugins, ear, antlr, codeQuality, cpp, maven, integTest, jetty, osgi, sonar, signing, performance} core Build path Build Path Problem

./gradlew --version

------------------------------------------------------------ Gradle 1.0-milestone-9 ------------------------------------------------------------

Gradle build time: Tuesday, March 13, 2012 4:10:09 PM UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.2 compiled on December 20 2010 Ivy: 2.2.0 JVM: 1.6.0_29 (Apple Inc. 20.4-b02-402) OS: Mac OS X 10.7.3 x86_64

It’s a problem with mapping Gradle’s view of the world to Eclipse’s view of the world. Dependencies are much more coarse grained in Eclipse than in Gradle,which is why you can have cycles in Eclipse when there are none in Gradle. One potential solution is to map the multi-project Gradle build to a single Eclipse project, but the Gradle Eclipse plugin isn’t currently flexible enough to do this.

We hope to fix this some day. Until then, the IDE of choice for working on the Gradle project is IntelliJ IDEA (which is what Gradle committers use).

I’ve linked GRADLE-2200 for this.

In order to resolve the problem you can configure eclipse to treat project dependency cycles as ‘warnings’. You can do it in Eclipse via: Window > Preferences > Java > Compiler > Building > Build path problems > Circular dependencies = Warning.

Let’s leave the jira ticket open because we may find a better solution in future.