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

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/

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.

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 to set the POM data.