{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/960","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/960/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/960/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/960/events","html_url":"https://github.com/gradle/gradle/issues/960","id":193095657,"number":960,"title":"Circular dependencies inside the 'gradle' project itself ","user":{"login":"scais","id":4539192,"avatar_url":"https://avatars.githubusercontent.com/u/4539192?v=3","gravatar_id":"","url":"https://api.github.com/users/scais","html_url":"https://github.com/scais","followers_url":"https://api.github.com/users/scais/followers","following_url":"https://api.github.com/users/scais/following{/other_user}","gists_url":"https://api.github.com/users/scais/gists{/gist_id}","starred_url":"https://api.github.com/users/scais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scais/subscriptions","organizations_url":"https://api.github.com/users/scais/orgs","repos_url":"https://api.github.com/users/scais/repos","events_url":"https://api.github.com/users/scais/events{/privacy}","received_events_url":"https://api.github.com/users/scais/received_events","type":"User","site_admin":false},"labels":[{"id":460356597,"url":"https://api.github.com/repos/gradle/gradle/labels/a:bug","name":"a:bug","color":"d93f0b","default":false},{"id":478384995,"url":"https://api.github.com/repos/gradle/gradle/labels/from:contributor","name":"from:contributor","color":"0052cc","default":false},{"id":281294573,"url":"https://api.github.com/repos/gradle/gradle/labels/in:dependency-management","name":"in:dependency-management","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-02T11:34:11Z","updated_at":"2016-12-05T22:20:44Z","closed_at":null,"body":"Hello,\r\n\r\n  I found out that there is probably a circular dependency (https://issues.gradle.org/browse/GRADLE-3378) somewhere in the 'gradle' project itself. When I try to gather all dependencies from the configuration, I am getting 'java.lang.StackOverflowError (no error message)'.\r\n\r\nWhen I run with '--stacktrace' option, I am getting (the last line is repeated many times):\r\n\r\n```\r\nCaused by: java.lang.StackOverflowError\r\n        at com.google.common.base.Objects.hashCode(Objects.java:78)\r\n        at org.gradle.internal.component.model.DefaultIvyArtifactName.hashCode(DefaultIvyArtifactName.java:79)\r\n        at org.gradle.internal.component.external.model.DefaultModuleComponentArtifactIdentifier.hashCode(DefaultModuleComponentArtifactIdentifier.java:83)\r\n        at org.gradle.api.internal.artifacts.DefaultResolvedArtifact.hashCode(DefaultResolvedArtifact.java:83)\r\n        at org.gradle.api.internal.artifacts.DefaultResolvedDependency$ResolvedArtifactComparator.compare(DefaultResolvedDependency.java:207)\r\n        at org.gradle.api.internal.artifacts.DefaultResolvedDependency$ResolvedArtifactComparator.compare(DefaultResolvedDependency.java:188)\r\n        at org.gradle.api.internal.artifacts.DefaultResolvedDependency.sort(DefaultResolvedDependency.java:122)\r\n        at org.gradle.api.internal.artifacts.DefaultResolvedDependency.getModuleArtifacts(DefaultResolvedDependency.java:101)\r\n        at org.gradle.api.internal.artifacts.DefaultResolvedDependency.getAllModuleArtifacts(DefaultResolvedDependency.java:107)\r\n        at org.gradle.api.internal.artifacts.DefaultResolvedDependency.getAllModuleArtifacts(DefaultResolvedDependency.java:109)\r\n...\r\n```\r\nI checked the 'DefaultResolvedDependency.java' and found out that on line 109, the child dependencies are being added, i.e\r\n\r\n```\r\n...\r\nallArtifacts.addAll(childResolvedDependency.getAllModuleArtifacts());\r\n...\r\n```\r\n\r\nUnfortunately I was not able to identify the exact circular dependency, but got some results from my investigation. The problem occurs at least for the project **announce** when resolving dependency on **org.gradle:internalIntegTesting:3.3-20161202104347+0000** \r\n\r\nCan anyone please have a look?\r\n\r\n### Expected Behavior\r\nI should not get 'java.lang.StackOverflowError (no error message)' when going through the Gradle project dependencies.\r\n\r\n### Context\r\nI am working on a project which gathers information from gradle-based projects (dependencies, source files etc.) In order to retrieve only transitive dependencies from a configuration, I am using the 'resolvedDependency.getAllModuleArtifacts()' - 'resolvedDependency.getModuleArtifacts()' This works for 10+ open-source projects I tried (e.g. Mockito, hibernate-orm, caffeine etc.) but when used for Gradle itself, I am getting 'java.lang.StackOverflowError (no error message)'\r\n\r\n### Steps to Reproduce (for bugs)\r\n1. Clone gradle repository (https://github.com/gradle/gradle)\r\n2. Add this task to the 'build.gradle' (of the root project)\r\n\r\n```\r\ntask stackoverflow << {\r\n\tproject.getConfigurations().each { configuration ->\r\n\t\tconfiguration.getResolvedConfiguration().getFirstLevelModuleDependencies().each { dependency ->\r\n\t\t\tdependency.getAllModuleArtifacts()\r\n\t\t}\r\n\t}\r\n}\r\n```\t\r\n\r\n3. Run _./gradlew stackoverflow_ \r\n\r\n### Your Environment\r\nWindows 7 64B, Java 8 64B, no Java options specified, gradle deamon off\r\n"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/264996580","html_url":"https://github.com/gradle/gradle/issues/960#issuecomment-264996580","issue_url":"https://api.github.com/repos/gradle/gradle/issues/960","id":264996580,"user":{"login":"eriwen","id":51534,"avatar_url":"https://avatars.githubusercontent.com/u/51534?v=3","gravatar_id":"","url":"https://api.github.com/users/eriwen","html_url":"https://github.com/eriwen","followers_url":"https://api.github.com/users/eriwen/followers","following_url":"https://api.github.com/users/eriwen/following{/other_user}","gists_url":"https://api.github.com/users/eriwen/gists{/gist_id}","starred_url":"https://api.github.com/users/eriwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eriwen/subscriptions","organizations_url":"https://api.github.com/users/eriwen/orgs","repos_url":"https://api.github.com/users/eriwen/repos","events_url":"https://api.github.com/users/eriwen/events{/privacy}","received_events_url":"https://api.github.com/users/eriwen/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T22:20:44Z","updated_at":"2016-12-05T22:20:44Z","body":"From @bigdaz in the forums:\r\n\r\n> Would you be interested in contributing a fix? I think the fix would be in DefaultResolvedDependency, and we'd need some unit test coverage in DefaultResolvedDependencySpec."}}
{"actor":{"display_login":"eriwen"}}