Plugin Publishing - How to remove Pom dependencies?

Hey Guys,
I can’t find any documentation on this, so I’m posting here in the hopes that someone will know how to solve this.

I’ve got a fat jar that I’m attempting to publish to the plugin repo. As it’s a fat jar, the Pom file being generated by the Plugin Publisher should not have any dependencies listed. Unfortunately I can’t find a way to do that.

When publishing to our internal Nexus I’m able to achieve this by doing the following:

publications {
  shadow(MavenPublication) {
    pom.withXml {
        Node pomNode = asNode()

However, I’ve not been able to find a publications instance for the plugin publisher, and see no options how to modify the pom as such. Any suggestions?

After about half a day of searching (including the plugin-publish-plugin code), I managed to find the undocumented magic to remove dependencies from the generated jar. Maven calls this a ‘reduced dependency jar’

Here’s the result, with the hopes it will save others hours of searching

  pluginBundle {
  // Standard config cruft removed for brevity.
    withDependencies {