Using ant-contrib in TeamCity

Our build uses the ant-contrib <for> task, and I'm having trouble getting the reference to the jar to work.

The build script includes the line:

    <taskdef resource="net/sf/antcontrib/antcontrib.properties" />



so if the ant-contrib.jar is in the class path, things should work fine.  But during the build, I get the error:

[for] Problem: failed to create task or type for Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any <presetdef>/<macrodef> declarations have taken place.

I've tried:
* putting ant-contrib.jar into $AGENT$/plugins/ant/lib
* changing build configuration, Ant runner, to specify -lib /absolute/path/to/ant-contrib.jar in the Additional Ant command line parameters

neither of those fixed the issue.  I see this old discussion: http://devnet.jetbrains.net/message/5133573#5133573 but there is no longer a ant165.jar in the specified location on the TeamCity server.

What's the recommended approach for getting this working?
1 comment
Comment actions Permalink

Apparently in ant 1.8.4, either in TC or standalong, using a *.properties resource doesn't work very well.  My problem was resolved by changing that to <taskdef> to:


    <taskdef resource="net/sf/antcontrib/antlib.xml" />


and have ant-contrib.jar in the AGENT/plugins/ant/lib
0

Please sign in to leave a comment.