# Pom-files for multi-flavored android lib not published on uploadArchives-task

**URL:** https://discuss.gradle.org/t/pom-files-for-multi-flavored-android-lib-not-published-on-uploadarchives-task/898
**Category:** Old Forum Archive
**Created:** [January 2, 2015, 10:04am UTC](https://discuss.gradle.org/t/pom-files-for-multi-flavored-android-lib-not-published-on-uploadarchives-task/898 "2015-01-02T10:04:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Volkmar\_Seifert](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@Volkmar\_Seifert](https://discuss.gradle.org/u/Volkmar_Seifert)
#### Post date: [January 2, 2015, 10:04am UTC](https://discuss.gradle.org/t/pom-files-for-multi-flavored-android-lib-not-published-on-uploadarchives-task/898/1 "2015-01-02T10:04:00Z")

</div>

I am having trouble uploading my two-flavored android library to mavenCentral _completely_. By completely, I mean that all files are uploaded but the pom.xml files. Apart from the pom-file, each flavor is uploaded just fine (and that includes the signature-files for the pom-files) as an independent artifact, and I even can download and use them via gradle, as long as I know the dependency-parameters by heart. However, the artifacts cannot be looked up via search nor synced across the repositories, because of those missing pom-files. I have read a lot in this and other forums, but no solution actually worked out, so I am posting this question more or less “again”, because my case was never among the cases I found - or at least not with an answer.

Here’s the code I use (it’s embedded into a script-file, and uses some functions I did not provide here, you can take a look at the complete code at my github-repo of the library in question: [AndroDialogs](https://github.com/dimensionv/androdialogs):

` afterEvaluate { project ->`

uploadArchives {

repositories {

mavenDeployer {

beforeDeployment { MavenDeployment deployment -\> signing.signPom(deployment) }

credentialProps.load(new FileInputStream(credentialsPropsFile))

repository(url: getReleaseRepositoryUrl()) {

authentication(userName: credentialProps[‘NEXUS\_USER’], password: credentialProps[‘NEXUS\_PASSWORD’])

}

snapshotRepository(url: getSnapshotRepositoryUrl()) {

authentication(userName: credentialProps[‘NEXUS\_USER’], password: credentialProps[‘NEXUS\_PASSWORD’])

}

android.ext.flavors.each {

def String flavorRelease = it + ‘Release’

def String flavorName = it

addFilter(it) { artifact, file -\>

artifact.attributes.classifier.contains(flavorRelease)

}

pom(it).groupId = POM\_GROUP\_ID

pom(it).artifactId = POM\_ARTIFACT\_ID + ‘-’ + it

pom(it).version = versionString

pom(it).project {

def String pomName = POM\_NAME + ’ (’ + flavorName + ‘)’

name pomName

packaging POM\_PACKAGING

description POM\_DESCRIPTION

url POM\_URL

scm {

url POM\_SCM\_URL

connection POM\_SCM\_CONNECTION

developerConnection POM\_SCM\_DEV\_CONNECTION

}

licenses {

license {

name POM\_LICENCE\_NAME

url POM\_LICENCE\_URL

distribution POM\_LICENCE\_DIST

}

}

developers {

developer {

id POM\_DEVELOPER\_ID

name POM\_DEVELOPER\_NAME

}

}

}

}

}

}

}

signing {

required { isReleaseBuild() && gradle.taskGraph.hasTask(“uploadArchives”) }

credentialProps.load(new FileInputStream(credentialsPropsFile))

allprojects {

ext.‘signing.secretKeyRingFile’ = credentialProps[‘SIGNING\_SECRET\_KEY\_RING\_FILE’]

ext.‘signing.keyId’ = credentialProps[‘SIGNING\_KEY\_ID’]

ext.‘signing.password’ = credentialProps[‘SIGNING\_PASSWORD’]

}

sign configurations.archives

} } ``
