Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-2175

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

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

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

    problem - Snapshot dependencies with sources/test classifier are not updated (complete)

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

Duplicated by

Bug - A problem which impairs or prevents the functions of the product. GRADLE-2218 eclipse plugin : Snapshot dependencies with sources classifier are not updated beside the first time runing "gradle eclipse"

  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Remote Attachments
  • Commits
  • Source
  • Reviews
Hide
Permalink
Gradle Forums added a comment - 15/Mar/12 1:04 PM

Hi Ben,

What Gradle version? And what's the repository definition that this dependency will be coming from?

Show
Gradle Forums added a comment - 15/Mar/12 1:04 PM Hi Ben, What Gradle version? And what's the repository definition that this dependency will be coming from?
Hide
Permalink
Gradle Forums added a comment - 15/Mar/12 1:04 PM

Gradle version M8a

The repository is a Nexus Maven repo.

I meant to mention that if I run --refresh dependencies, then that brings down the latest test jar. So it is possible, but I'd prefer it to work like a standard changing dependency.

Show
Gradle Forums added a comment - 15/Mar/12 1:04 PM Gradle version M8a The repository is a Nexus Maven repo. I meant to mention that if I run --refresh dependencies, then that brings down the latest test jar. So it is possible, but I'd prefer it to work like a standard changing dependency.
Hide
Permalink
Gradle Forums added a comment - 15/Mar/12 1:04 PM

I just noticed that the version in:

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

Doesn't look right. Is that a copy/paste error?

Show
Gradle Forums added a comment - 15/Mar/12 1:04 PM I just noticed that the version in: group: 'foo', name: 'core', version: '1.0-SNAPSHOT.jar', classifier: 'test' Doesn't look right. Is that a copy/paste error?
Hide
Permalink
Gradle Forums added a comment - 15/Mar/12 1:04 PM

sorry yes that's a typo

As I say - it works OK first time (i.e. nothing in local cache), and if I do --refresh dependencies.

I suspect it is using the default caching resolution strategy rather than the zero seconds one I have specified. I'll try to see today if I get a new version down after 24hrs.

Show
Gradle Forums added a comment - 15/Mar/12 1:04 PM sorry yes that's a typo As I say - it works OK first time (i.e. nothing in local cache), and if I do --refresh dependencies. I suspect it is using the default caching resolution strategy rather than the zero seconds one I have specified. I'll try to see today if I get a new version down after 24hrs.
Hide
Permalink
Gradle Forums added a comment - 15/Mar/12 1:04 PM

A bit more detail in case it is useful

we create the test code jar like so:

task testsJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output.classesDir
}

and publish to nexus by adding it to the artifacts like so:

artifacts {
archives sourcesJar
archives testsJar
}

FWIW we also seem to have the same problem with the sources jar.

Show
Gradle Forums added a comment - 15/Mar/12 1:04 PM A bit more detail in case it is useful we create the test code jar like so: task testsJar(type: Jar, dependsOn: testClasses) { classifier = 'tests' from sourceSets.test.output.classesDir } and publish to nexus by adding it to the artifacts like so: artifacts { archives sourcesJar archives testsJar } FWIW we also seem to have the same problem with the sources jar.
Hide
Permalink
caiweiwei added a comment - 13/Jun/12 10:27 PM

This issue still reappear in 1.0-rc3

Show
caiweiwei added a comment - 13/Jun/12 10:27 PM This issue still reappear in 1.0-rc3
Hide
Permalink
Daz DeBoer added a comment - 28/Jun/12 4:41 PM

I've confirmed this is an issue: it is caused by the fact that artifacts with classifiers are not available via ModuleDescriptor.getAllArtifacts(), and so we don't expire them from the cache when we expire the module from the cache. See ChangingModuleVersionRepository#expireArtifactsForChangingModule().

Show
Daz DeBoer added a comment - 28/Jun/12 4:41 PM I've confirmed this is an issue: it is caused by the fact that artifacts with classifiers are not available via ModuleDescriptor.getAllArtifacts(), and so we don't expire them from the cache when we expire the module from the cache. See ChangingModuleVersionRepository#expireArtifactsForChangingModule().
Hide
Permalink
caiweiwei added a comment - 29/Jun/12 12:42 AM

Will fix?

Show
caiweiwei added a comment - 29/Jun/12 12:42 AM Will fix?
Hide
Permalink
Adam Murdoch added a comment - 03/Jul/12 4:18 PM

yes

Show
Adam Murdoch added a comment - 03/Jul/12 4:18 PM yes
Hide
Permalink
caiweiwei added a comment - 22/Jul/12 8:28 PM

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

Show
caiweiwei added a comment - 22/Jul/12 8:28 PM When? Or any method we can do about it? Thank you.
Hide
Permalink
Adam Murdoch added a comment - 22/Jul/12 10:04 PM

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
Adam Murdoch added a comment - 22/Jul/12 10:04 PM 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.

People

  • Assignee:
    René Gröschke
    Reporter:
    Gradle Forums
Vote (4)
Watch (10)

Dates

  • Created:
    15/Mar/12 1:04 PM
    Updated:
    09/Jan/13 9:47 AM
    Resolved:
    11/Dec/12 11:51 PM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.