Skip to content

Snapshots

lifengsofts edited this page Mar 14, 2017 · 3 revisions

Obtaining Snapshots

Jar

Jars can be downloaded directly from Sonatype. Double check the date to make sure you're getting the latest version.

Gradle

Add the snapshot repo to your list of repositories:

repositories {
  jcenter()
  maven {
    name 'glide-snapshot'
    url 'http://oss.sonatype.org/content/repositories/snapshots'
  }
}

And then change your dependencies to the v3 snapshot version:

dependencies {
  compile 'cn.woblog.android:downloader:1.0.0-SNAPSHOT'
}

Maven

Add the following to your ~/.m2/settings.xml:

<profiles>
  <profile>
     <id>allow-snapshots</id>
     <activation><activeByDefault>true</activeByDefault></activation>
     <repositories>
       <repository>
         <id>snapshots-repo</id>
         <url>https://oss.sonatype.org/content/repositories/snapshots</url>
         <releases><enabled>false</enabled></releases>
         <snapshots><enabled>true</enabled></snapshots>
       </repository>
     </repositories>
   </profile>
</profiles>

Then change your dependencies to the snapshot version:

<dependency>
  <groupId>cn.woblog.android</groupId>
  <artifactId>downloader</artifactId>
  <version>1.0.0-SNAPSHOT</version>
</dependency>

Building snapshots locally

If you want to get the same files that would be released execute this command:

./gradlew clean buildArchives uploadArchives --stacktrace --info -PSNAPSHOT_REPOSITORY_URL=file:///Users/Pich/Documents/work/repo -PRELEASE_REPOSITORY_URL=file:///Users/Pich/Documents/work/repo

Then change your dependencies to the local snapshot version:

repositories {
  maven { name 'android-downloader-local'; url '/Users/Pich/Documents/work/repo' }
}
dependencies {
  compile 'cn.woblog.android:downloader:x.y.z-SNAPSHOT'
}