A super easy way to release Android and Java artifacts to Artifactory.
This is a helper to simplify the configuration of the Artifactory Gradle 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"
classpath "guru.stefma.androidartifacts:androidartifacts:$androidArtifactsVersion" // <1>
}
}
Then you are able to apply the guru.stefma.artifactorypublish
plugin:
apply plugin: "com.android.library"
apply plugin: "guru.stefma.artifacts" // <1>
apply plugin: "guru.stefma.artifactorypublish"
artifactoryPublish {
artifactoryRepo = "example-repo-local"
artifactoryUrl = "http://localhost:8081/artifactory"
publications = ["releaseAar"] // <2>
}
- //1: This plugin requires the availability of the
guru.stefma.artifacts
plugin. See here more information. - //2: To see a list of all available publications just run the
androidArtifactGeneratedPublications
task.
There are several configuration options. The following table give you a overview about all of them:
Property | Description | Mandatory | Property finder* |
---|---|---|---|
artifactoryUrl | Url to your artifactory | ✅ | ❌ |
artifactoryRepo | The Repository name | ✅ | ❌ |
artifactoryUser | Artifactory username | ✅ | ✅ |
artifactoryKey | API Key or Password | ✅ | ✅ |
publications | The publications you want to publish | ✅ | ❌ |
*can be added via Gradle properties
To publish your library to artifactory simply run
./gradlew clean build artifactoryPublish -PartifactoryUser=ARTIFACTORY_USERNAME -PartifactoryKey=ARTIFACTORY_KEY