Customize the pom for install and upload

Is there a way to apply pom customizations in a #gradle build to both install & uploadArchives tasks at once?

This is possible. Have a look at this sample: https://github.com/gradle/gradle/blob/master/subprojects/docs/src/samples/maven/pomGeneration/build.gradle

We will make this more convenient in the future.

Another approach I took was to configure the POM for the installer, and then in the mavenDeployer { } section, I put “pom = installer.repositories.mavenInstaller.pom” - I needed to do this rather than Hans’ approach because I’m configuring the POM from within a plugin, and the deployer wasn’t always available at the time I was trying to configure it.

Here is another approach.

It is defining a complete POM in a closure which is reused in both installer and deployer.