------ Failing the Build if JUnit is Missing ------ Benjamin Bentmann ------ March 2008 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Failing the Build if JUnit is Missing The build scripts generated by the Ant Plugin require JUnit to run the unit tests. By default, the <<>> will only output a warning if JUnit was not found on the class path, i.e. the build simply continues without running the unit tests. If you rather want the build to fail in this case, you can easily customize the <<>> by overriding the target <<>>: +-----+ ... ==================================== ERROR ==================================== JUnit is not present in your $ANT_HOME/lib directory, aborting build. Please copy "junit.jar" to "${ant.libdir}". =============================================================================== JUnit not found on class path, cannot run unit tests. ... +-----+