Hello,
i am using the Android Gradle Plugin (v. 1.0.0) to build and deploy an android library project to a Nexus Repository. My Library has multiple product flavors and i want all flavors to be deployed to a repository.
To make all variants an output artifact of the Gradle project I set “publishNonDefault true” in build.gradle (See: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication)
To deploy my artifacts i use the uploadArchives Task of the maven plugin. The problem is, when i run the uploadArchives task, all artifacts are deployed as .aar files successfully, but without any POM-file.
When publishing only one flavor the artifact is uploaded correctly with a POM-file.
While trying to deploy all flavors I found out that in the buildDir/poms directory only one „default-pom.xml“ was generated. So I added filters for each flavor as stated here: http://www.gradle.org/docs/current/userguide/maven_plugin.html#sub:multiple_artifacts_per_project
Now I finally have a pom.xml for each flavor, for example: pom-flavor1Debug.xml or pom-flavor2Debug.xml But the problem is still there: None of these pom-Files are deployed to my repository.
Is it possible to deploy multiple flavors of a library as .aar with different POM-files at all? Am I missing something?
build.grade:
apply plugin: 'com.android.library'
android {
productFlavors {
flavor1 {}
flavor2 {}
}
publishNonDefault true
}
apply plugin: 'maven'
uploadArchives {
repositories {
mavenDeployer {
repository(url: "url to repository"){
}
addFilter('flavor1Debug') {artifact, file ->
artifact.attributes.classifier.equals("flavor1Debug")
}
addFilter('flavor2Debug') {artifact, file ->
artifact.attributes.classifier.equals("flavor2Debug")
}
pom('flavor1Debug').artifactId = "flavor1-debug"
pom('flavor2Debug').artifactId = "flavor2-debug"
}
}
}