How do I properly define the pom file with the new maven-publish plugin?

In the old maven plugin I could do something like:

uploadArchives {
  repositories.mavenDeployer {
    pom.project {
      name '...'
      developers { /* ... */
      /* define more pom element */

That doesn’t seem to work with the new plugin anymore, since it has a new type of ‘MavenPom’. So what the documentation suggests is:

publishing {
  publications {
    maven(MavenPublication) {
      pom.withXml {
        asNode().appendNode('description', 'A demonstration of Maven POM customization')
      }
    }
  }
}

This seems to be a lot of text if you have to do this for any of the elements inside the pom. Is there an easier way (like using the XmlBuilder for that) and what would be the prefered way to have something similiar to the old plugin?

Apologies for the delayed reply. This forum post has a less verbose (albeit not particularly elegant) solution: http://forums.gradle.org/gradle/topics/new_publishing_model_and_pom_customization_via_xmlprovider

Thanks for your reply. Will there be any improvements in the syntax for defining the POM?

Currently that’s the reason I am still including the old maven plugin into my projects, and not using the new one (since functional it seem to work pretty fine).

At some stage we’d like to improve the syntax, but it’s not high on our priority list. There’s no reason to switch to the new publishing support if you don’t need any of the new features: we won’t deprecate the old mechanism until the new mechanism is un-incubated. And we won’t remove it until Gradle 3.0 at the earliest.