Plugins being used are: 'com.jfrog.artifactory' and 'maven-publish'
The root build.gradle:
buildscript {
repositories {
maven {
url 'http://localhost:8081/artifactory/globalmaven'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0"
}
}
allprojects {
repositories {
maven {
url 'http://localhost:8081/artifactory/globalmaven'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
group = 'com.my.package'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
artifactoryPublish {
clientConfig.info.setBuildName('My_special_build_name')
clientConfig.info.setBuildNumber('1')
}
artifactory {
contextUrl = 'http://localhost:8081/artifactory'
publish {
repository {
repoKey = 'Libs-snapshot-local'
username = project.getProperties().artifactory_user
password = project.getProperties().artifactory_password
}
defaults {
publishArtifacts = true
publishPom = false
publishIvy = false
}
}
resolve {
repository {
repoKey = 'globalmaven'
}
}
}
And the app build.gradle
apply plugin: 'com.android.application'
version = "1.0"
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.my.package"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName version
}
buildTypes {
debug {
versionNameSuffix "-SNAPSHOT"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:23.0.1'
}
publishing.publications {
apk(MavenPublication) {
groupId group
artifactId 'MyArtifact'
artifact("$buildDir/outputs/apk/${project.getName()}-debug.apk")
}
}
The problem is that the apk is not uploaded to Artifactory, the build descriptor is being uploaded and everything looks good just no apk artifact (The apk is built, I've verified that it exists and is named correctly and is in the correct path).
Output:
$ ./gradlew artifactoryPublish
[buildinfo] Not using buildInfo properties file for this build.
:artifactoryPublish
Deploying build descriptor to: http://localhost:8081/artifactory/api/build
Build successfully deployed. Browse it in Artifactory under http://localhost:8081/artifactory/webapp/builds/My_special_build_name/1
BUILD SUCCESSFUL