I’d like to be able to customise the pom that’s used by the publishPlugins task of the Plugin Publish plugin. My project already has the Maven plugin applied and its pom is customised as follows:
It looks like the publishPlugins task is generating a separate pom file, build/publish-generated-resources/pom.xml. How can I customise this pom or, even better, have the publishPlugins task use the existing pom?
But I cannot find any information on how to customize the generated POM file. Not even the “vcsUrl” parameter is used to populate the SCM section of the POM file, and I also would like to add the typical information like license, organization, issueManagement, and so on. Is there really no way to do this?
Thanks for the info Andy, do you use the old maven plugin or the maven-publish plugin to publish to the plugin registry instead?
It’s kind of sad that there are three official plugins for publishing Maven artifacts and none of them fits all needs. And that the “new” maven-publish plugin is in incubation for over six years now (since Gradle 1.3) does not make me very confident that this will improve.
Neither. Instead we publish via Artifactory to Bintray. We then set the necessary metadata that allows the Plugin Portal to find the new plugin version. However, that’s far more influenced by our build and release process across several OSS projects than any deficiencies of Gradle. I’m not sure I’d recommend it in general.
It seems the POM can now be customized in version 0.10.0 of the plugin-publish-plugin, I just noticed this sentence in the description: “Reuse of POM (including customizations) generated by maven-publish, if java-gradle-plugin and maven-publish are applied.” (https://plugins.gradle.org/plugin/com.gradle.plugin-publish)