The same dependency resolves with Maven. In later versions of Gradle, rather than failing immediately, the resolve gets stuck in a deep recursion, will sometimes succeed, or stackoverflowing and OOMing when printing the stacktrace.
Given that the parent POM couldn’t be found under the relative path, Gradle would try to resolve the parent POM with the given GAV and therefore gets caught into an infinite loop. My guess is that Maven has a built-in mechanism to break such loops.
Gradle ignores relativePath, it’s only relevent to the maven build for org.springframework.uaa.client when the ../osgi-bundle folder exists on the local file system.
Gradle can only use the GAV to lookup the parent pom when referencing the artifact from a repository.
I’m surprised that maven allows the parent GAV to be the same as the artifact, or any circular dependency in the parent GAV hierarchy. I consider this to be a bug in the pom rather than a bug in gradle. It would be nice if gradle detected the circular dependency and gave a nicer error message
eg:
Detected circular dependency in parent hierarchy org.springframework.uaa:org.springframework.uaa.client:1.0.1.RELEASE → org.springframework.uaa:org.springframework.uaa.client:1.0.1.RELEASE