Artifact cache - sources artifact update

With version milestone-8a I’ve observed an update problem with the sources artifacts which I could only solve by deleting the affected artifacts from the cache.

For gwt compilation I need both the main and the sources artifact of a dependency. For the regular build everything seams to be ok. The main and the sources artifact is loaded into the artifacts jar subdir of the artifact cache. When building eclipse the sources artifact is surprisingly loaded again but in the the artifacts sources subdir of the artifact cache. Normally this seams to work.

But over the time I don’t know how both versions diverged somehow. The jar version of the sources artifact was always outdated the sources version was always up-to-date.

Interestingly the build script selected always the outdated version from the jar dir even if I put this sources artifact into the regular java compile classpath.

The modules cache dir:

  ±–anyModule  |

—1.0.0-SNAPSHOT |

±–jar |

|

±–45cae11ea8a2f2e50f3d481f6f05f480f62b3aa9 |

|

|

anyModule-1.0.0-SNAPSHOT-sources.jar //this one was outdate but selected |

|

| |

|

±–66f780b6c2ae986df0b9e328be1c0cd7b9b86172 |

|

|

anyModule-1.0.0-SNAPSHOT-resources.jar |

|

| |

|

±–a3303a4df83b0b8ce23d14a5d717e992b982c281 |

|

|

anyModule-1.0.0-SNAPSHOT.jar |

|

| |

|

±–ef9cb8fefbf64a511012d73c8bff3f45991c84 |

|

|

anyModule-1.0.0-SNAPSHOT.jar |

|

| |

|

±–f0e38663dee0d2d5c75ea1ea18d28adfe6212350 |

|

|

anyModule-1.0.0-SNAPSHOT.jar |

|

| |

|

—ff9bb902a69e87244ab257d3ed6406d15702b628 |

|

anyModule-1.0.0-SNAPSHOT.jar |

| |

±–javadoc |

|

—5f387a3002746faa8b6a8b11e374fd57acb7df96 |

|

anyModule-1.0.0-SNAPSHOT-javadoc.jar |

| |

±–pom |

|

±–316a831627fef381089c12d14557b97631b4941e |

|

|

anyModule-1.0.0-SNAPSHOT.pom |

|

| |

|

—5412639226608e5d51136358d287ac2e6422b06 |

|

anyModule-1.0.0-SNAPSHOT.pom |

| |

—source |

—37ad1a66369755ddc078611f74e9828bfcc90056

|

anyModule-1.0.0-SNAPSHOT-sources.jar //this one is up-to-date but not selected

Sounds like you explicitly reference the sources Jar as a dependency. Update to rc-1 and try ‘–refresh-dependencies’. By default, Gradle will check for new snapshots every 24 hours.

Thanks, the --refresh-dependencies switch helps.

But nevertheless it seems to be a bug. Once I change something in our commons library I run in this problem.

When using it as external dependency I see the *-sources.jar is downloaded to the cache into the source dir but the older version from the jar dir of the cache is selected to build.

Yes there is an explicit source dependency which we need in order to build our GWT stuff. This is unfortunately required by the gwt compiler.

The *-sources.jar is two times available in the cache. And one of them is in my case always outdated. Unfortunately the build selects always the outdated version. I guess either one of those copies should be dropped or both of them should be up-to-date.

I’ve configured the cache to always check if a newer version is available. But this doesn’t solve the problem. I would persistently need to build with --refresh-dependencies switch.

subprojects {
  configurations.all {
    resolutionStrategy.cacheDynamicVersionsFor 0, SECONDS
    resolutionStrategy.cacheChangingModulesFor 0, SECONDS
  }
}