What does UploadArchives Task Upload?

Hey there,

I am using Gradle to build Android projects, since this is the way Google says things are done.
I configured my build gradle’s uploadArchives task plain and simple (see below).

Now using gradle with Android, usually two “runs” are executed - a Debug build and a Release build.
Also, the output folders contain build artifacts for both configurations if I execute “gradle clean build”.
However, when I execute uploadArchives task as I do, the archives which are uploaded neither have a -debug nor -release suffix and I am completely lost as to what the task actually uploaded.
So questions:

  1. Which artifacts does the uploadArchives task pick up for upload?
  2. Is there a way to configure that the upload archives task uploads both debug and release version separately? If so, how would this be done?


Here my configuration:

apply plugin: “maven”


    mavenUpload "org.apache.maven.wagon:wagon-http:2.2"

task assembleJavadocs(type: Jar, dependsOn: "javadoc"){
    classifier "javadoc"
    extension "zip"
    from "${project.buildDir}/docs/javadoc"
    destinationDir file("${project.buildDir}")

artifacts {
    archives assembleJavadocs

uploadArchives {

    repositories.mavenDeployer {
        repository(url: "XXXX")

Hey Florian,

to select which flavour to publish you can use this snippet:

android {
    defaultPublishConfig "flavor1Debug"

here the “flavour1Debug” variant is published. As a default the release
build type is published. To publish all different variants you can do

android {
    publishNonDefault true

This is described in more detail in the android gradle plugin userguide
at http://tools.android.com/tech-docs/new-build-system/user-guide

If you need a further customization here you’d need to configure the
artifacts to be published using the artifacts{} configuration block. You
find a description and further details about this in the gradle

Thanks a lot René!

That was the answer I needed!