ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fotis Jannidis" <>
Subject problem with writing a task
Date Thu, 02 Mar 2000 23:52:08 GMT
I have problems to write a task. The example in the doc files doesn't work (it uses two 
variables, 'msg' and 'message'):

public class MyVeryOwnTask extends Task {
      private String msg;

      // The method executing the task
      public void execute() throws BuildException {

      // The setter for the "message" attribute
      public void setMessage(String msg) {
        this.msg = msg;

Even if I set everything to 'message' I get a nullpointerexception thrown by

I tried it without any attributes and setters in the class, but had the same result. I also

tried different approaches to make the new task class accessible: putting it into the 
classpath or putting it into /jre/lib/ext: nothing helped. From the commandline a man 
method in this class is accessible.

I use jdk 1.2.2 on win 98. 

Maybe somebody could point me to a working example?
Thanks in advance,

In the ant docs the next example would profit by using the same attribute, that is 
'message', instead of myattr:

      <target name="test">
        <mytask myattr="wombat" />

Another point: If you subscribe to ant-dev, you get a help file which repeatedly points 
you to, p.e. in <>, which must be

View raw message