# How to elegantly customize the pom.xml using the new publishing plugin

**URL:** <https://discuss.gradle.org/t/how-to-elegantly-customize-the-pom-xml-using-the-new-publishing-plugin/5797>\
**Category:** Old Forum Archive\
**Created:** [June 24, 2014, 7:32am UTC](https://discuss.gradle.org/t/how-to-elegantly-customize-the-pom-xml-using-the-new-publishing-plugin/5797 "2014-06-24T07:32:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![etiennestuder](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/etiennestuder/32/7153_2.png) [@etiennestuder](https://discuss.gradle.org/u/etiennestuder)\
**Post date:** [June 24, 2014, 7:32am UTC](https://discuss.gradle.org/t/how-to-elegantly-customize-the-pom-xml-using-the-new-publishing-plugin/5797/1 "2014-06-24T07:32:00Z")

</div>

Hi

Is there a more elegant (Groovy) way than repeatedly calling appendNode() to customize the pom.xml?

```gradle
publishing {
    publications {
        mavenJava(MavenPublication) {
         from components.java
           pom.withXml {
                asNode().appendNode('name', 'some name')
                asNode().appendNode('description', 'some description')
                asNode().appendNode('developers').appendNode('developer').
                        appendNode('id', 'someid').parent().
                        appendNode('name', 'somename').parent().
                        appendNode('email', 'someemail')
                  asNode().appendNode('licenses').appendNode('license').
                        appendNode('name', 'Apache License, Version 2.0').parent().
                        appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.html')
            }
        }
    }
    ....
}

```

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [June 24, 2014, 2:05pm UTC](https://discuss.gradle.org/t/how-to-elegantly-customize-the-pom-xml-using-the-new-publishing-plugin/5797/2 "2014-06-24T14:05:00Z")

</div>

Not sure if I’d call it ‘elegant’, but you can use ‘Node.plus()’ to append content using the Groovy XmlMarkupBuilder.

See this forum post for more details: [http://forums.gradle.org/gradle/topics/new\_publishing\_model\_and\_pom\_customization\_via\_xmlprovider](http://forums.gradle.org/gradle/topics/new_publishing_model_and_pom_customization_via_xmlprovider)

---

<div class="post-metadata">

**Author:** ![etiennestuder](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/etiennestuder/32/7153_2.png) [@etiennestuder](https://discuss.gradle.org/u/etiennestuder)\
**Post date:** [June 24, 2014, 4:58pm UTC](https://discuss.gradle.org/t/how-to-elegantly-customize-the-pom-xml-using-the-new-publishing-plugin/5797/3 "2014-06-24T16:58:00Z")

</div>

This is definitely more elegant than what I had before. Thanks, Daz.

---

<div class="post-metadata">

**Author:** ![quidryan](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/quidryan/32/73_2.png) [@quidryan](https://discuss.gradle.org/u/quidryan)\
**Post date:** [June 24, 2014, 6:23pm UTC](https://discuss.gradle.org/t/how-to-elegantly-customize-the-pom-xml-using-the-new-publishing-plugin/5797/4 "2014-06-24T18:23:00Z")

</div>

This is good stuff to put into a plugin. We put most of the updating of the pom into the nebula-publishing-plugin, and the developers section into the gradle-contacts-plugin. I’m still looking to put the license bits and the scm bits into appropriate plugins.
