[GRADLE-3118] Defined dependency artifact not used when resolving a module with no metadata file Created: 02/Jul/14 Updated: 07/Jul/14 Resolved: 07/Jul/14 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 2.1-rc-1 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Daz DeBoer |
Resolution: | Fixed | Votes: | 0 |
Known Issue Of: |
Description |
This is a regression in dependency resolution in Gradle 2.0. The issue occurs when there is no ivy.xml for a module, and the dependency declares and artifact where the artifact name does not match the module name. When trying to locate the module metadata, Gradle 2.0 will search first for the ivy.xml file for the module, then the default 'jar' artifact. Instead Gradle should be searching for the declared artifact if the ivy.xml file is not found. |
Comments |
Comment by Gradle Forums [ 02/Jul/14 ] |
Hi, I can't observe a difference using this script and 2.0 and 1.12. Would you mind providing some instructions we can follow to observe the difference? |
Comment by Gradle Forums [ 02/Jul/14 ] |
Ok...here is a basic HelloWorld gradle project with one dependencies.... apply plugin: 'java' sourceCompatibility = 1.5 def artifactory_contextUrl = hasProperty('artifactory_contextUrl') ? repositories { dependencies { Here is the build output using gradle version 1.12 C:\Users\jmessmer\IdeaProjects\gradleDependencyHandlerTest>which gradle C:\Users\jmessmer\IdeaProjects\gradleDependencyHandlerTest>gradle build BUILD SUCCESSFUL Total time: 3.052 secs Here is the build output when I try do use gradle version 2.0: C:\Users\jmessmer\IdeaProjects\gradleDependencyHandlerTest>which gradle C:\Users\jmessmer\IdeaProjects\gradleDependencyHandlerTest>gradle build FAILURE: Build failed with an exception.
BUILD FAILED Total time: 7.425 secs C:\Users\jmessmer\IdeaProjects\gradleDependencyHandlerTest> As you can see, my artifact has a different nomenclature than the module name....I am not sure if I need to do something different and how when I go to gradle 2.0 Thanks, |
Comment by Daz DeBoer [ 04/Jul/14 ] |
I can confirm this is a regression in dependency resolution in Gradle 2.0. The issue occurs when there is no ivy.xml for a module, and the artifact name does not match the module name. The tricky thing is that it looks like this has been already fixed in master, even though there's been no corresponding bug report. Can you try a recent nightly build (http://gradle.org/nightly) and see if it fixes your problem? |
Comment by Andreas Nyberg [ 05/Jul/14 ] |
I spent most of yesterday battling with this problem: an ivy module declared a dependency on another ivy module with an explicit artifact, but the resolver didn't look for the named artifact but only one with the name of the module.
|
Comment by Daz DeBoer [ 05/Jul/14 ] |
Thanks Andreas. The main thing we want to do now is address the regression in 2.0. My belief is that it has now been fixed in master. Any chance that you can try a nightly build (http://gradle.org/nightly) and confirm if this is the case. Regarding your other suggestions, I would recommend taking this discussion to the Gradle developers list (http://www.gradle.org/development). |