Thanks @twwwt, I am aware of that but it does not help with the Plugin Publishing Plugin.
Btw, you could use this syntax which I find more readable (credits go to @daz, see New publishing model and POM customization via XmlProvider) :
def pomConfig = {
description project.description
inceptionYear project.ext.inceptionYear
organization {
name project.ext.organization
url project.ext.organizationURL
}
...
}
publishing {
publications {
mavenJava(MavenPublication) {
pom.withXml {
asNode().children().last() + pomConfig
}
}
}
}