Maybe you could use such a workaround: in Maven you can activate a profile if some property is not set:
<project>
...
<profiles>
<profile>
<id>failure_profile</id>
<activation>
<property>
<name>!env</name>
</property>
</activation>
</profile>
</profiles>
</project>
Then you shall force this profile always fail, e.g. using maven-enforcer-plugin:
<profile>
<id>failure_profile</id>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<AlwaysFail/>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
If you don't provide -Denv build will then fail:
[INFO] [enforcer:enforce {execution: enforce}]
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.AlwaysFail failed with message:
Always fails!
[INFO] ---------------------------------------------------------
[ERROR] BUILD ERROR
Well, it's much more verbose then Ant, but pure Maven :)