Question

I discovered the Parallel deployment feature in Tomcat 7 and I would like to use it in my app. I already have an Ant script to build and deploy the app but I would like to know if there is a nice way to combine it with Parallel deployment. I am now able to generate the file but when I try to use it in the deploy:

<deploy url="" username="" password="" path="" war="file:ROOT##${versionNum}"/>

I don't get the expected result because Ant don't seems to interpret the '#' character correctly. How can I solve it? Is it a problem with XML or an Ant specific problem?

Was it helpful?

Solution

Taking out the file: prefix from war attribute allows it to find the file. I'm guessing there is a way to escape the ## for a file: URI but it works without it.

Secondly, you need to specify the version attribute in the deploy tag. See http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Supported_Manager_Commands. Otherwise your war will appear in the webapps directory as foo.war instead of foo##0000.war.

<deploy url="" username="" password="" path="" war="foo##${versionNum}.war" version="${versionNum} />

I found the ant BuildNumber task useful: https://ant.apache.org/manual/Tasks/buildnumber.html

<buildnumber /> sets ${build.number} based on a number in a file that it also increments.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top