| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Ant example source code file (extended-taskdef.xml)

This example Ant source code file (extended-taskdef.xml) is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Ant tags/keywords

buildexception, buildexception, foo, foo, try, try

The extended-taskdef.xml source code

<project name="extended-taskdef" default="testRun">

    Try and replicate a reported problem.

  <property name="src" value=""/>
  <property name="taskdefs" value=""/>

  <target name="write" >
    <echo file="${src}">

      public class Foo extends {

        public void execute() {
          throw  new BuildException("executing the Foo task");
    <propertyfile file="${taskdefs}">
      <entry key="foo2" value="Foo"/>

  <target name="compile" depends="write">
    <javac srcdir="${basedir}" includes="${src}"/>

  <target name="testRun" depends="compile">
    <taskdef name="foo" classname="Foo"
    <foo maxwait="5" maxwaitunit="second"

  <target name="testRun2" depends="compile">
    <taskdef resource="${taskdefs}" classpath="${basedir}"/>
    <foo2 maxwait="5" maxwaitunit="second"

  <target name="teardown">
      <fileset dir="${basedir}"
    <delete file="${taskdefs}" />


Other Ant examples (source code examples)

Here is a short list of links related to this Ant extended-taskdef.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.