Home

Awesome

CircleCI License Download

ArtifactoryPublish

A super easy way to release Android and Java artifacts to Artifactory.

Description

This is a helper to simplify the configuration of the Artifactory Gradle plugin.

How to use it

Apply the plugin

Put this into your project build.gradle:

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        // The current version can be found here https://git.io/vdsOs
        classpath "guru.stefma.artifactorypublish:artifactorypublish:$artifactoryPublishVersion"
    }
}

Then you are able to apply the guru.stefma.artifactorypublish plugin:

apply plugin: "com.android.library"
apply plugin: "guru.stefma.artifactorypublish" 

version = "0.0.1"
group = "guru.stefma.artifactorypublish"

// For Java/Kotlin modules
javaArtifact {
    artifactId = "my-java-module"
}
// or for Android modules
androidArtifact {
    artifactId = "my-android-module"
}

artifactoryPublish {
    artifactoryRepo = "example-repo-local"
    artifactoryUrl = "http://localhost:8081/artifactory"
    publications = ["releaseAar"] // <1>
}

Configuration

There are several configuration options. The following table give you a overview about all of them:

PropertyDescriptionMandatoryProperty finder*
artifactoryUrlUrl to your artifactory
artifactoryRepoThe Repository name
artifactoryUserArtifactory username
artifactoryKeyAPI Key or Password
publicationsThe publications you want to publish

*can be added via Gradle properties

Publish

To publish your library to artifactory simply run

./gradlew clean build artifactoryPublish -PartifactoryUser=ARTIFACTORY_USERNAME -PartifactoryKey=ARTIFACTORY_KEY