# Unable to upload a pom file to artifactory using maven-publish plugin in gradle

**URL:** <https://discuss.gradle.org/t/unable-to-upload-a-pom-file-to-artifactory-using-maven-publish-plugin-in-gradle/4062>\
**Category:** Old Forum Archive\
**Created:** [August 18, 2014, 6:54am UTC](https://discuss.gradle.org/t/unable-to-upload-a-pom-file-to-artifactory-using-maven-publish-plugin-in-gradle/4062 "2014-08-18T06:54:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anu\_V](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Anu\_V](https://discuss.gradle.org/u/Anu_V)\
**Post date:** [August 18, 2014, 6:54am UTC](https://discuss.gradle.org/t/unable-to-upload-a-pom-file-to-artifactory-using-maven-publish-plugin-in-gradle/4062/1 "2014-08-18T06:54:00Z")

</div>

I have a requirement to publish a master manifest/integration manifest (pom) file which will have other manifest (pom) as dependencies for individual artifacts.

When I try to upload using the maven-publish command like this : apply plugin: ‘maven-publish’

publishing {

repositories {

maven {

url ‘[http://artifactory.test.com/artifactory/test-sandbox-local/](http://artifactory.test.com/artifactory/test-sandbox-local/)’

generatePom = false }

}

masterMani(MavenPublication) {

groupId ‘manifest.test’

artifactId ‘master-prod’

version ‘1.0.1-140812’

artifact file(“/scratch/master-prod.pom”)

generatePom = false

} }

When I run publish task with above gradle file, I get the error :

:publishMasterManiPublicationToMavenRepository FAILED

FAILURE: Build failed with an exception.

- What went wrong: Execution failed for task ‘:publishMasterManiPublicationToMavenRepository’. \> Failed to publish publication ‘masterMani’ to repository ‘maven’

> Invalid publication ‘masterMani’: multiple artifacts with the identical extension and classifier (‘pom’, ‘null’).

Cannot we publish a custom pom file alone through maven-publish plugin, is yes, how ? If not, then what is alternative way to publish it.

---

<div class="post-metadata">

**Author:** ![cmcginty](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/cmcginty/32/2209_2.png) [@cmcginty](https://discuss.gradle.org/u/cmcginty)\
**Post date:** [August 20, 2014, 1:53am UTC](https://discuss.gradle.org/t/unable-to-upload-a-pom-file-to-artifactory-using-maven-publish-plugin-in-gradle/4062/2 "2014-08-20T01:53:00Z")

</div>

the ‘artifact’ property is for an archive like a JAR. If you want to force the POM I think you need to use a different method.

Try using [‘’‘pom.withXml’’’ API](http://www.gradle.org/docs/current/dsl/org.gradle.api.publish.maven.MavenPom.html#org.gradle.api.publish.maven.MavenPom:withXml%28org.gradle.api.Action%29) to set the POM data.
