ant.Task;
import org.apache.tools.ant.BuildException;

public class HelloWorld extends Task {

    String message;
    public void setMessage(String msg) {
        message = msg;
    }

    public void execute() {
        if (message==null) {
            throw new BuildException("No message set.");
        }
        log(message);
    }

}
</pre>
<p>Oh, what's that in execute()? Throw a <i>BuildException</i>? Yes, that's the usual
way to show Ant that something important is missed and complete build should f