Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-2175

Snapshot dependencies with sources/test classifier are not considered 'changing'

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4-rc-1
    • Gradle Forums topic Reference:

      Description

      We publish source and test code jars for common libraries to Nexus.

      So we end up with something like:

      core-1.0-SNAPSHOT.jar
      core-1.0-SNAPSHOT-sources.jar
      core-1.0-SNAPSHOT-test.jar

      Then I refer to the test jar from another project like so:

      testCompile group: 'foo', name: 'core', version: '1.0-SNAPSHOT.jar', classifier: 'test'

      This works the first time it is run but the updates do not get downloaded. So I have the usual:

      configurations.all {
      resolutionStrategy

      { //don't cache snapshots cacheChangingModulesFor 0, 'seconds' }

      }

      This works for the main artifact but not for the test jar. What can I do to get the test jar to update like a normal SNAPSHOT?

      Cheers, Ben

        Issue Links

          Activity

          Hide
          cwocwo caiweiwei added a comment -

          Will fix?

          Show
          cwocwo caiweiwei added a comment - Will fix?
          Hide
          adammurdoch Adam Murdoch added a comment -

          yes

          Show
          adammurdoch Adam Murdoch added a comment - yes
          Hide
          cwocwo caiweiwei added a comment -

          When?
          Or any method we can do about it?
          Thank you.

          Show
          cwocwo caiweiwei added a comment - When? Or any method we can do about it? Thank you.
          Hide
          adammurdoch Adam Murdoch added a comment -

          I can't give you an accurate answer. It's queued up to be fixed 'soon', probably in the Gradle 1.2 or 1.3 timeframe. The fix won't make it into Gradle 1.1.

          Show
          adammurdoch Adam Murdoch added a comment - I can't give you an accurate answer. It's queued up to be fixed 'soon', probably in the Gradle 1.2 or 1.3 timeframe. The fix won't make it into Gradle 1.1.
          Hide
          hexucheng hexucheng added a comment -

          Is this bug fixed? I am an android application developer and my android studio project use gradle 2.8, this bug is still exist. I upload libary project aar and source jar to nexus maven snapshot repository like this(execute gradle uploadArchives):

          apply plugin: 'maven'

          version = "x.x.x-SNAPSHOT"

          uploadArchives {
          repositories {
          mavenDeployer {
          repository(
          url: "http://x.x.x.x:x/nexus/content/repositories/releases/")

          { authentication(userName: nexusUsername, password: nexusPassword) pom.groupId = "xxx.xxx.xxx" pom.artifactId = "xxx" }

          snapshotRepository(
          url: "http://x.x.x.x:x/nexus/content/repositories/snapshots/")

          { authentication(userName: nexusUsername, password: nexusPassword) pom.groupId = "xxx.xxx.xxx" pom.artifactId = "xxx" }

          }
          }
          }

          task sourcesJar(type: Jar)

          { from android.sourceSets.main.java.srcDirs classifier = 'sources' }

          artifacts

          { archives sourcesJar }

          and declared dependencies in other application project like this:

          configurations.all

          { // check for updates every build resolutionStrategy.cacheChangingModulesFor 0, 'seconds' }

          dependencies

          { compile group:'xxx.xxx.xxx', name:'xxx', version:'x.x.x-SNAPSHOT', changing:true }

          but it will not check and update every build. If only upload libary project aar, it works fine.

          Show
          hexucheng hexucheng added a comment - Is this bug fixed? I am an android application developer and my android studio project use gradle 2.8, this bug is still exist. I upload libary project aar and source jar to nexus maven snapshot repository like this(execute gradle uploadArchives): apply plugin: 'maven' version = "x.x.x-SNAPSHOT" uploadArchives { repositories { mavenDeployer { repository( url: "http://x.x.x.x:x/nexus/content/repositories/releases/") { authentication(userName: nexusUsername, password: nexusPassword) pom.groupId = "xxx.xxx.xxx" pom.artifactId = "xxx" } snapshotRepository( url: "http://x.x.x.x:x/nexus/content/repositories/snapshots/") { authentication(userName: nexusUsername, password: nexusPassword) pom.groupId = "xxx.xxx.xxx" pom.artifactId = "xxx" } } } } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } artifacts { archives sourcesJar } and declared dependencies in other application project like this: configurations.all { // check for updates every build resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } dependencies { compile group:'xxx.xxx.xxx', name:'xxx', version:'x.x.x-SNAPSHOT', changing:true } but it will not check and update every build. If only upload libary project aar, it works fine.

            People

            • Assignee:
              breskeby René Gröschke
              Reporter:
              forums Gradle Forums
            • Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development