Gradle project hieratch is inconsistent for 'ProjectName'


(sirinath1978m) #1

I am getting the above error. Let me know what might be wrong

apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'scala'
apply plugin: 'eclipse'
  repositories {
 mavenCentral()
 mavenLocal()
 maven {
  url "http://maven.ow2.org/maven2/"
 }
 maven {
  url "http://maven.ow2.org/maven2-snapshot/"
 }
 maven {
  url "http://oss.sonatype.org/content/groups/public/"
 }
 maven {
  url "http://repository.jboss.org/nexus/content/groups/public-jboss/"
 }
 maven {
  url "http://download.java.net/maven/2/"
 }
 maven {
  url "http://snapshots.repository.codehaus.org/"
 }
 maven {
  url "http://repository.codehaus.org/"
 }
 maven {
  url "http://repo1.maven.org/maven2/"
 }
 maven {
  url "http://repo2.maven.org/maven2/"
 }
 maven {
  url "http://repo.fusesource.com/maven2/"
 }
 maven {
  url "http://repo.typesafe.com/typesafe/releases/"
 }
 maven {
  url "http://repo.typesafe.com/typesafe/snapshots/"
 }
 maven {
  url "http://scala-tools.org/repo-releases/"
 }
 maven {
  url "http://scala-tools.org/repo-snapshots/"
 }
 maven {
  url "http://akka.io/releases/"
 }
 maven {
  url "http://akka.io/snapshots/"
 }
 flatDir {
  dirs 'lib'
 }
}
  dependencies {
 testCompile 'org.uncommons:reportng:1.1.2'
 testCompile 'org.testng:testng:6.3.1'
}
  configurations {
 compile
 runtime {
        extendsFrom compile
    }
 }
  test {
 useTestNG()
 systemProperties "org.uncommons.reportng.stylesheet": "${projectDir}/resources/hudsonesque.css"
 options {
   listeners << 'org.uncommons.reportng.HTMLReporter'
   listeners << 'org.uncommons.reportng.JUnitXMLReporter'
 }
}
    eclipse {
 project {
  name = 'TestingFrameworkParent'
      buildCommand 'org.eclipse.jdt.core.javabuilder'
      natures 'com.springsource.sts.gradle.core.nature', 'org.eclipse.jdt.groovy.core.groovyNature'
 }
 classpath {
  containers 'GROOVY_SUPPORT', 'GROOVY_DSL_SUPPORT', 'com.springsource.sts.gradle.classpathcontainer'
 }
    downloadSources = true
 downloadJavadoc = true
}

(Peter Niederwieser) #2

Please read Guidelines for writing good forum posts.


(sirinath1978m) #3

I am as clue less about this error. I do not how to elaborate more. There is not stack trace produced than the above error message. BTW, there are times this error is not raised. I am also very new to Gradle and Groovy and still learning the ropes.


(Peter Niederwieser) #4

I’m looking for information like:

  • What exact Gradle command did you run? * What is the exact output? * What is the stack trace when you run with --stacktrace? * Doesn’t this error occur in the IDE rather than on the command line (that’s what I remember from an earlier issue)?

(sirinath1978m) #5

I use STS. I guess when there is a stack trace it is printed. This happens on and off. If one day I keep getting this error another day I might not.


(Peter Niederwieser) #6

As far as I can tell, this error message doesn’t come from Gradle. I recommend to ask on the STS list.


(Dan Stine) #7

We run into this with the STS Gradle Support sometimes, too. We’re using Eclipse 3.7.1 EE, STS 2.8.1 and STS Gradle Support 2.8.0.

The first thing to check is the pointer to the Gradle distribution. In Window | Preferences | Gradle, we are setting the URI to a local copy of gradle-1.0-milestone-6-all.zip. Sometimes when we see the “hieratch” error, the URI has been reset to http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip. Changing back to 1.0-milestone-6 sometimes clears up the problem.

If that doesn’t work, we try an unscientific combination of

  1. Refresh Eclipse project (F5) 2) Gradle | Refresh Dependencies 3) Close/Open the Eclipse project and even 4) Restart Eclipse

and can generally clear it up.


(sirinath1978m) #8

I always change the distro as you said. Also I have observed the other combinations working. This is such a pain and can lead to lot of unproductive hours.


(Peter Niederwieser) #9

I assume you have asked for help in the STS forum? Can you post the link? What did they say?