We Have an Ant Task, ...
... all you have to do is to copy these lines into your build.xml file:
<taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask" classpathref="project.class.path" />
I have been dutifully doing this in every one of my build.xml files that needs the task. (Well, not only this one, but other tasks from other tools.) At first, it is novel and exciting, "Look, I just added a snippet of XML to build.xml, and it can do this!" But it's getting old now, especially on the one thousandth time: "What's the class name of that task? And which jar file is it in?" I've tried external entity references which only obscures the issue.
What I want is a way to tell my installation of Ant about any new Ant tasks that's avaiable in third party packages. Do it once. And have that task available to all Ant runs that use the installation, like any other task that come bundled with Ant.
There must be a way to do this that I missed.
Re: We Have an Ant Task, ...
A second workaround is to put all of your taskdefs in a single Ant buildfile, then use the Ant import task to always import your taskdefs. It's still a single line of code you have to add to your buildfiles, but it is only a single line instead of multiple lines.
Re: We Have an Ant Task, ...
Thanks, Eric.
I like the first approach a lot better than the second one. It seems to me the file (org/apache/tools/ant/taskdefs/defaults.properties in ant.jar) is make for this purpose.
With the help of Emacs (one of two of my favorite editors, the other being vim), editing the file in ant.jar is no harder than editing a regular file.
Instead of making a copy of the jar file, I made a symbolic link. This saves some disk space. It also ensures that any future updates to the jar file (as long as the path and name is not changed) will be reflected in Ant. (Windows/NTFS does not support symbolic links, but does support hard links---one file showing up in two different directories. You can create hard links with the Cygwin ln command.)
A side effect of doing this is that when I ran the antstructure task, the new task's syntax shows up in ant.dtd. Now I can have command completion for the new tasks.