Customising the pom created by the Plugin Publish plugin

Customizing the generated POM is possible for the “new” Maven publish plugin. We are doing this for years. Excerpt from how we do it:

publishing
{
	publications
	{
		mavenJava(MavenPublication)
		{
			pom.withXml
			{
				def pom = asNode()
				pom.appendNode 'description', project.description
				pom.appendNode 'inceptionYear', project.ext.inceptionYear

				def n = pom.appendNode 'organization'
				n.appendNode 'name', project.ext.organization
				n.appendNode 'url', project.ext.organizationURL

				n = pom.appendNode 'issueManagement'
				n.appendNode 'system', project.ext.issuesSystem
				n.appendNode 'url', project.ext.issues

				n = pom.appendNode 'ciManagement'
				n.appendNode 'system', project.ext.ciSystem
				n.appendNode 'url', project.ext.ci

				n = pom.appendNode 'scm'
				// ... and so on
			}
		}
	}
}