I am having this problem with Version 2.1.1(build 4261).
specifically, it doesn't seem to recognize junit.
I get the following error:
/home/teamcity/tomcat/buildAgent/work/Server/rb_1_0_0/build.xml:361: Problem: failed to create task or type junit
Cause: the class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-a directory added on the command line with the -lib argument
Do not panic, this is a common problem.
The commonest cause is a missing JAR.
This is not a bug; it is a configuration problem
I have tried this with both the Teamcity bundled ant, as well as the one on the system.
The junit tests run correctly if i run them from the console.