[GRADLE-3017] Internal Ivy Dependency descriptor is not updated when dependencies have changed Created: 07/Feb/14  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.10
Fix Version/s: None

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Won't Fix Votes: 1


Gradle 1.10 does not update cached generated Ivy Dependency XML, even after --refresh dependencies

Gradle 1.10 appears to cache generated Ivy Dependency XML in ~/.gradle/caches/modules-2/metadata-2.1/descriptors////ivy.xml - for given maven dependency

I happened to have a wrong version specified in dependencies

{ .. compile... }

block for the give artefact.

  • Even after correcting and running the compile task, it kept failing saying that the dependency could not be resolved
  • running with --refresh dependencies worked fine
  • then if you run WITH OUT --refresh dependencies, same issue came up
  • after some digging around, realised that gradle creates ivy.xml for maven dependencies and that it is not regenerated upon change to dependencies
  • more over --refresh dependencies seems to ignore or not update the required ivy.xml

Rather a frustrating bug. I almost lost faith in Gradle due to this. IMHO, the caching aspects of Gradle are a bit over-engineered! Good stuff though - hard nut, but great

Comment by Gradle Forums [ 07/Feb/14 ]

Are you saying that you only have this problem with 1.10? Can you provide a minimal self-contained reproducible example?

Comment by Gradle Forums [ 07/Feb/14 ]

Thanks. I will try to isolate this problem and send the files. It may take a day or two I did not try other later versions.

Comment by René Gröschke (Inactive) [ 07/Feb/14 ]

To reproduce this Do the following:

  • publish projectA with dependency on "org.slf4j:slf4j-api:1.5.7" to artifactory
  • create projectB with dependency on projectA -> transitive dependencies are resolved correctly
  • update and publish with projectA with changed dependency from "org.slf4j:slf4j-api:1.5.7" to "org.slf4j:slf4j-api:1.6.0"
  • when running projectB again (even with --refresh-modules) still pointing to org.slf4j:slf4j-api:1.5.7
  • the ivy.xml of projectA in our internal module descriptor is still pointing to 1.5.7 (not updated at all)
Comment by Adam Murdoch [ 06/Apr/14 ]

René Gröschke, in step 3 are you publishing projectA with the same version as in step 1, or a different version?

Comment by René Gröschke (Inactive) [ 06/Apr/14 ]

yes, in step 3 projectA has the same version ("1.0-SNAPSHOT"). BUT I can't reproduce this with the latest master anymore. When running with 1.10 I can see in step 4, that "org.slf4j:slf4j-api:1.6.0" is resolved (downloading pom & jar) but in the dependencies tree, I still see 1.5.7. With latest master the transitive dependency points correctly to 1.6.0, so the issue seems to be fixed.

Comment by René Gröschke (Inactive) [ 06/Apr/14 ]

There is an explicit testcase for this in https://github.com/gradle/gradle/blob/d09fd7e2c6685a02efd5197b75405f0e19c240e4/subprojects/core-impl/src/integTest/groovy/org/gradle/integtests/resolve/maven/MavenSnapshotResolveIntegrationTest.groovy#L516 which shows this is fixed since 1.11. But we never heard back from the guy who raised this issue in the forum to verify this fix finally. I suppose we set the issue to 'fixed'

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:37:38 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.