Publish Android aar to artifactory

I am stuck in integrating the artifactory 3.0.1 plugin with Gradle. I am using Android Studio 1.0, so I assume I'm on Gradle 2.0. Any examples of publishing to artifactory using the 3.0.1 plugin would be very helpful.

Thanks in advance

+4
source share
3 answers

JFrog publishes a fully functional example of publishing aar in Artifactory. Here you go . Select the version of the plugin you are working with and see the aar example.

0
source

Artifactory - . , com.jfrog.artifactory maven-publish, artifactoryPublish Gradle. ... , : ·)

build.gradle:

apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'

publishing {
    publications {
        aar(MavenPublication) {
            groupId 'com.fewlaps.something' //put here your groupId
            artifactId 'productname' //put here your artifactId
            version '7.42.0' //put here your library version

            // Tell maven to prepare the generated "*.aar" file for publishing
            artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
        }
    }
}

artifactory {
    contextUrl = 'https://your-artifactory-host.com/artifactory'
    publish {
        repository {
            repoKey = "libs-release-local"
            username = "username"
            password = "password"
        }
        defaults {
            // Tell the Artifactory Plugin which artifacts should be published to Artifactory.
            publications('aar')
        }
    }
}

./gradlew artifactoryPublish

, , GitHub, .travis.yml

deploy:
  - provider: script
    script: ./gradlew artifactoryPublish
    skip_cleanup: true
    on:
      tags: true

GitHub, , vX.X.X Travis:

# Build only master and "vX.X.X" tags to prevent flooding Travis machines
branches:
  only:
    - master
    - /^v\d+\.\d+\.\d+$/
0

Source: https://habr.com/ru/post/1569267/