Get hands-on training for JIRA Software, Confluence, and more at Atlassian Summit Europe. Register now ›

I just thought I should share this great little gem I stumbled across last week when I was faced with this Crowd Issue.
After a few quick searches on Google I came across this great little Ant library, XMLTask. After downloading the jar and having a quick read of the great example docs, I had resolved my issue in 5 minutes,”how awesome is that!” (as Justen would say 😉 )
Here is a quick example of what I did:

<!– This will set Tomcat’s HTTP Connector and SHUTDOWN ports –>

<echo> Changing Tomcat’s connector port to ${crowd.tomcat.connector.port} </echo>

<xmltask source=”${tomcat}/conf/server.xml” dest=”${tomcat}/conf/server.xml”>

  <replace path=”/Server/Service/Connector/@port” withText=”${crowd.tomcat.connector.port}” />

</xmltask>

<echo> Changing Tomcat’s shutdown port to ${crowd.tomcat.shutdown.port} </echo>

<xmltask source=”${tomcat}/conf/server.xml” dest=”${tomcat}/conf/server.xml”>

  <replace path=”/Server/@port” withText=”${crowd.tomcat.shutdown.port}” />

</xmltask>

So with two very simple commands a had XML/XPath manipulation of Tomcat’s server.xml file.
So if you need some XML support for an Ant script you are writing or even a Maven 2 Ant Plugin, I would definitely suggest XMLTask.

Fresh ideas, announcements, and inspiration for your team, delivered weekly.

Subscribe now

Fresh ideas, announcements, and inspiration for your team, delivered weekly.

Subscribe now