title: Why does this macrodef fail?
body: <p>I am trying to print out a local timestamp for every target in a build xml. I have this macrodef to try and work around the same timestamp being printed every time.</p>
  
  <pre><code>&lt;macrodef name="timestamp.echo"&gt; 
      &lt;attribute name="message"/&gt; 
          &lt;sequential&gt; 
              &lt;local name="current.time" /&gt;
                  &lt;tstamp&gt; 
                      &lt;format property="current.time" pattern="dd/MM/yyyy hh:mm:ss.SSS"/&gt; 
                  &lt;/tstamp&gt; 
                      &lt;echo message="${current.time}@{message}" /&gt;
          &lt;/sequential&gt; 
  &lt;/macrodef&gt;
  </code></pre>
  
  <p>and this code sits at  the end of every target but within the target - </p>
  
  <pre><code>&lt;timestamp.echo message="Mail sent" /&gt;
  </code></pre>
  
  <p>when I ran this on a local task it worked perfectly however when I run with Jenkins it fails. I get this error message - </p>
  
  <pre><code>Problem: failed to create task or type local
  Cause: The name is undefined.
  Action: Check the spelling.
  Action: Check that any custom tasks/types have been declared.
  Action: Check that any &lt;presetdef&gt;/&lt;macrodef&gt; declarations have taken place.
  </code></pre>
  
  <p>I am struggling as I have declared the name and cannot see the cause of the problem. Any help is appreciated.</p>
  
  <p><strong>ANSWER FOR FUTURE REFERENCES</strong></p>
  
  <p>For earlier Ant versions I discovered this will do the job to create a local timestamp - </p>
  
  <pre><code>&lt;target name="timestamp"&gt;
    &lt;tstamp&gt;
      &lt;format property="current.time" pattern="MM/dd/yyyy hh:mm:ss.SSS" /&gt;
    &lt;/tstamp&gt;
    &lt;echo message="${current.time} ${message}" /&gt;      
  &lt;/target&gt;
  </code></pre>
  
  <p>and then inserting this into a target will work - </p>
  
  <pre><code>      &lt;antcall target="timestamp"&gt;
          &lt;param name="message" value="Completed" /&gt;
        &lt;/antcall&gt;
  </code></pre>