Wednesday, December 9, 2015

Adding additional Jar files to Ant ClassPath in TeamCity

I recently began working with Java again after a period of many, many years and had to start working with Ant to perform some Java builds.

Well, I soon discovered that, unlike MSBuild, Ant does not have a built-in XMLTask!!

There is a company that has provided this functionality to Ant in the form of a separate .jar file called xmltask.jar.  http://www.oopsconsultancy.com/software/xmltask/  On the downside, since this is not included as part of Ant, you have to specify the path to the .jar file while you are building your Ant script.

TeamCity supports this through Ant command line parameters in the Ant Build Step:  https://confluence.jetbrains.com/display/TCD9/Ant

You specifically need something like the following line to reference your additional Ant libraries:
-lib "%teamcity.tool.ant-net-tasks%"

In my case, I ended up using the following path:
-lib C:\BuildTools\xmltask.jar



That was all that was needed to get my Ant build script to build!!



 

No comments:

Post a Comment