On 08/03/2011, at 2:29 AM, Brett Cave wrote:
> Hi,
>
> I still get behaviour similar to this:
> http://gradle.1045684.n5.nabble.com/Snapshot-dependencies-not-updated-td1433032.html
> in gradle 1 m1 - is this behaviour normal / expected?
The default behaviour for a maven repo is to check for new snapshots once a
day. You can change the strategy on a per-repository basis:
mavenRepo(urls: '...') {
// Always check for new snapshots
snapshotTimeout = 0
}
Or you can set changing = true on the particular dependency.
>
> My ~/.gradle/init.gradle:
> addListener(new ArtifactoryGradleSettings())
> class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener
> {
>
> def void projectsLoaded(Gradle gradle) {
> Project root = gradle.getRootProject()
> root.allprojects {
>
> buildscript {
> repositories {
>
> org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials(artifactoryRealm,
> artifactoryHost, artifactoryUsername, artifactoryPassword);
> mavenRepo name: 'plugins', urls:
> "http://artifactory.local/artifactory/plugins"
> }
> }
>
> repositories {
> mavenRepo name: 'repo', urls:
> "http://artifactory.local/artifactory/repo"
> }
> }
> }
> }
>
>
> My project's build.gradle:
> configurations {
> the_tar
> }
> dependencies {
> def commonsVersion = "2.0.0-SNAPSHOT"
> the_tar "com.mycompany.commons:my-model:$commonsVersion@tar"
> }
>
> task getTheTar(type: Copy) {
> into "$projectDir/src/main"
> configurations.the_tar.findAll{it.name.endsWith('.tar')}.each {
> from tarTree(it)
> }
> include "resources/**/*.def"
> }
>
>
> The tar is not fetched (after about 6 rebuilds so far, with "-C rebuild"
> set). It fetches a new one if changing=true is set.
>
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
Co-Founder and VP of Engineering, Gradleware Inc. - Gradle Training, Support,
Consulting
http://www.gradleware.com