Gradle
  1. Gradle
  2. GRADLE-944

StackOverflowError with circular multiproject dependency

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Resolution: Unresolved
    • Affects Version/s: 0.9
    • Fix Version/s: None

      Description

      So I mistakenly created a circular dependency amongst a multiproject, so proj A had:
      dependencies {
      compile project(':projB')

      { transitive = true }
      }

      and proj B had
      dependencies {
      compile project(':projA') { transitive = true }

      }

      Clearly this is user error, but probably it would be good if gradle would detect the problem in the dependency mapping and print a "circular depenency detected" message instead of the huge stack trace.

      FAILURE: Build aborted because of an internal error.

      • What went wrong:
        Build aborted because of an unexpected internal error. Please file an issue at: www.gradle.org.
      • Try:
        Run with -d option to get additional debug info.
      • Exception is:
        java.lang.StackOverflowError: null
        at java.util.HashMap$KeyIterator.<init>(HashMap.java:875)
        at java.util.HashMap$KeyIterator.<init>(HashMap.java:875)
        at java.util.HashMap.newKeyIterator(HashMap.java:889)
        at java.util.HashMap$KeySet.iterator(HashMap.java:921)
        at java.util.HashSet.iterator(HashSet.java:154)
        at java.util.AbstractCollection.toArray(AbstractCollection.java:124)
        at java.util.LinkedList.addAll(LinkedList.java:265)
        at java.util.LinkedList.addAll(LinkedList.java:242)
        at java.util.LinkedList.<init>(LinkedList.java:98)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:47)
        at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
        at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
        at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)

        Issue Links

          Activity

          Hide
          Philip Crotwell
          added a comment -


          This might be related to GRADLE-766 and GRADLE-915

          Show
          Philip Crotwell
          added a comment - This might be related to GRADLE-766 and GRADLE-915
          Hide
          Adam Murdoch
          added a comment -

          This is the same as GRADLE-715.

          Show
          Adam Murdoch
          added a comment - This is the same as GRADLE-715 .

            People

            • Assignee:
              Unassigned
              Reporter:
              Philip Crotwell
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: