ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Keim" <>
Subject Re: Running optional tasks
Date Thu, 12 Apr 2001 00:17:24 GMT
See docs\manual\develop.html

It says there:
Adding your task to the system is rather simple too:

Make sure the class that implements your task is in the classpath when
starting Ant.
Add a <taskdef> element to your project. This actually adds your task to the

Use your task in the rest of the buildfile.


<?xml version="1.0"?>

<project name="OwnTaskExample" default="main" basedir=".">
  <taskdef name="mytask" classname="com.mydomain.MyVeryOwnTask"/>

  <target name="main">
    <mytask message="Hello World! MyVeryOwnTask works!"/>

Another way to add a task (more permanently), is to add the task name and
implementing class name to the file in the package. Then you can use it as if it were a
built-in task.

I'm trying to do it the permanent way but I'm not having any success.

----- Original Message -----
From: <>
To: <>
Sent: Wednesday, April 11, 2001 5:08 PM
Subject: Running optional tasks

> I downloaded Pvcs source compiled and put it into optional.jar, which is
> %ANT_HOME%\lib.
> When I try to use <pvcs  /> I get
>         Could not create task of type: pvcs. Common solutions are to use
>         to declare your task, or, if this is an optional task , to put the
>         optional.jar in the lib directory of your ant installation
> What am I doing wrong?
> Eric

View raw message