[GRADLE-2100] Ordering of repository declarations can cause Could not resolve all dependencies error Created: 14/Feb/12 Updated: 04/Jan/13 Resolved: 16/Feb/12 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.0-milestone-8 |
Fix Version/s: | 1.0-milestone-8a |
Type: | Bug | ||
Reporter: | Dan Stine | Assignee: | Daz DeBoer |
Resolution: | Fixed | Votes: | 1 |
Issue Links: |
|
Description |
(See forum post: http://forums.gradle.org/gradle/topics/could_not_resolve_all_dependencies_error_with_m8) Suppose I have a buildscript block that declares two repositories A and B (in that order), and then a standard repositories block that declares only repository B. And suppose that both the buildscript block and the standard dependencies block declare the same dependency. apply plugin: 'java' buildscript { repositories { maven { url "http://repository.springsource.com/maven/bundles/release" } maven { url "http://repo1.maven.org/maven2" } } dependencies { classpath 'org.springframework:spring-core:3.1.0.RELEASE' } } repositories { maven { url "http://repo1.maven.org/maven2" } } dependencies { compile 'org.springframework:spring-core:3.1.0.RELEASE' } If I manually clear the cache by deleting ~/.gradle/caches/{1.0-milestone-8,artifacts-8) and then run "gradle clean build", I will get the following error: FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':compile'. > Could not find group:org.springframework, module:spring-core, version:3.1.0.RELEASE. Required by: :local:unspecified Reversing the repository declarations in the buildscript block, manually clearing the cache, and re-running gradle results in a successful build. If I use mavenCentral() instead of manually specifying the URL, there is no problem. Per Daz on the forums:
|
Comments |
Comment by Dan Stine [ 21/Feb/12 ] |
1.0-milestone-8a fixes this issue for me. |