Apache Ant + Tomcat Deployer

Posted by Tim Kuehn on 13-Dec-2016 16:43

I'm working on an automated build/deployment system to take one or more services in a PDS project, create a .war file, and deploy it using apache ant.

I've determined that restman -deploy replaces runtime.props this making it unusable for my purposes.

As an alternative I've found Tomcat Client Deployer - it has all the jar file and ant build scripts needed to make a java application and deploy it. Looking at the ant script all I need to do is swipe the "deploy" task, add it to my ant script, and I'll have what I want. 

The code can be downloaded from Apache Tomcat here: https://tomcat.apache.org/download-70.cgi

The issue I'm running into is I get ant to "see" the .jar's in the deployer's library directory so my script's deploy ant task will work. I keep getting:

 java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter 

when I try to run my ant script. 

I could copy the deployer's .jar files into the ant's lib directory - I'd prefer to avoid that and any future maintenance headaches that could come with it. 

Has anyone else used an external library with ant and gotten ant to recognize code in an external library located in its own lib directory?

All Replies

Posted by Tim Kuehn on 13-Dec-2016 16:48

Another question - is there a way to do this while preserving restman's ability to enable/disable/update an application's properties?

Posted by cwright on 14-Dec-2016 07:21

Tim, You will probably have to add the external dependancies to your project. Simply add them to your maven package and they will be imported during your build. Then distribute those with you tool.

My 2 cents

Posted by Tim Kuehn on 14-Dec-2016 07:48

I don't have maven running quite yet, just ant.

This thread is closed