Multi-Module Maven Local & Remote Development Workflow Problem


(Martin Lyness) #1
configurations.all { resolutionStrategy.cacheChangingModulesFor 0, "seconds" }
      repositories {
        mavenLocal()
        maven {
           url 'xxx'
        }
     }

There is one problem i find with ordering the mavenLocal() before remote repositories. It will then use any SNAPSHOT found in the mavenLocal() whether or not it is older than the remote repository. This could become a confusing bug for teams when multiple developers are making changes to a foundation module shared in a remote repository.

Fail case steps: 1. Developer A updates Foundation Module 2. Developer A installs personal update with ‘gradle publishToMavenLocal’ 3. Developer A verifies Foundation Module within Project Module 4. Developer A deploys Foundation Module A to Remote Repository ‘gradle publish’ 4. Developer B updates Foundation Module A 5. Developer B publishes Foundation Module A to Remote Repository (‘gradle publish’) 6. Developer A attempts to use Developer B’s updates of Foundation Module A within Project Module but Gradle downloads his old mavenLocal() copy because it is the first match it finds.

Is there any way to change this behavior to search all repositories when dealing with a ‘changing version’? This seems like a more ideal implementation within Gradle. I verified this short coming in Gradle 1.12. Also, does a work around exist?


Multi-project (not multi-module) developer workflow