Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use latest snapshot version from the remote repo

For now, I should to specify version explicitly:

  dependencies {

      compile 'projGroup:projName:0.1-SNAPSHOT'
  }

What's I've tried, but it doesn't work:

  compile "projGroup:projName:0.+-SNAPSHOT"
  compile "projGroup:projName:+"

How can I tell gradle to use latest snapsot version from the remote maven repo?

like image 970
drets Avatar asked Mar 13 '14 08:03

drets


People also ask

How often maven should check for a newer snapshot artifact in the remote repository?

Artifacts with a newer timestamp take precedence no matter where they come from. With the default settings "remote timestamps" are checked only once every 24 hrs.

What is the difference between snapshot version and release version?

A "release" is the final build for a version which does not change. A "snapshot" is a build which can be replaced by another build which has the same name. It implies that the build could change at any time and is still under active development.

What is snapshot version?

It is a development version that precedes the final release version. You can identify a snapshot version of a Maven package by the suffix SNAPSHOT that is appended to the package version. For example, the snapshot of version 1.1 is 1.1-SNAPSHOT .

What is a snapshot version artifact?

Snapshot artifacts are artifacts generated during the development of a software project. A Snapshot artifact has both a version number such as “1.3. 0” or “1.3” and a timestamp in its name. For example, a snapshot artifact for commons-lang 1.3. 0 might have the name commons-lang-1.3.


2 Answers

Verified with Gradle 2.2.1:

  1. Override default 24h module caching in Gradle:

    configurations.all {
        resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    
  2. Then, latest.integration will work with each Maven snapshot:

    dependencies {
        compile 'projGroup:projName:latest.integration'
    }
    
like image 131
Jerzy Nowakowski Avatar answered Oct 13 '22 09:10

Jerzy Nowakowski


compile "projGroup:projName:latest.integration" should work.

like image 21
Peter Niederwieser Avatar answered Oct 13 '22 10:10

Peter Niederwieser