Your question raises one obvious question in return, why not simply use Maven to run JUnit? The surefire plugin will execute any tests (in the test phase) that were compiled in the test-compile phase into target/test-classes (usually the contents of src/test/java). There's a JavaWorld article giving an introduction to using Junit with Maven you might find helpful
Assuming you have a valid reason to use Ant to invoke the tests, you need to ensure that Ant is set up to fail if the tests are invalid. You can do this by configuring the JUnit task. The properties you may wish to set are haltonerror or haltonfailure. Alternatively you can set a property on failure and fail the Ant build yourself using the failureproperty property.
I've included two examples to demonstrate an Ant failure causing a Maven build failure. The first is a direct invocation of the fail task, the second invokes a task in a build.xml in the same manner as you have done.
This trivial example shows that an ant failure will cause a Maven build to fail:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<configuration>
<tasks>
<fail message="Something wrong here."/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: Something wrong here.
Extending the example to use an ant call as you have:
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<configuration>
<tasks unless="maven.test.skip">
<ant antfile="${basedir}/build.xml" target="test">
<property name="build.compiler" value="extJavac" />
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
With build.xml as:
<?xml version="1.0"?>
<project name="test" default="test" basedir=".">
<target name="test">
<fail message="Something wrong here."/>
</target>
</project>
Gives the following error:
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
test:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: The following error occurred while executing this line:
C:\test\anttest\build.xml:4: Something wrong here.