title: In Netbeans+Ant, how do I avoid wsimport rebuilding web service clients every build?
body: <p>I'm on a project where we use NetBeans (6.8). We use several different web services, which we have added as web service references, and Netbeans auto-generates the Ant <code>wsimport</code> scripts for us. Very handy, with one drawback: The web service clients are recompiled every time <code>ant</code> is invoked. This slows down the build process considerably and has caused the number of <a href="http://xkcd.com/303/" rel="nofollow noreferrer">sword-related injuries, maimings and deaths</a> to skyrocket.</p>
  
  <p>Normally, I'd fix this by changing the <code>wsimport</code> element from </p>
  
  <pre><code>&lt;wsimport 
      sourcedestdir="${build.generated.dir}/jax-wsCache/PonyService"
      destdir="${build.generated.dir}/jax-wsCache/PonyService"
      wsdl="${wsdl-PonyService}" 
      catalog="catalog.xml" 
      verbose="true"/&gt;
  </code></pre>
  
  <p>to </p>
  
  <pre><code>&lt;wsimport 
      sourcedestdir="${build.generated.dir}/jax-wsCache/PonyService"
      destdir="${build.generated.dir}/jax-wsCache/PonyService"
      wsdl="${wsdl-PonyService}" 
      catalog="catalog.xml" 
      verbose="true"&gt;
      &lt;produces dir="${build.generated.dir}/jax-wsCache/PonyService" /&gt;
  &lt;/wsimport&gt;
  </code></pre>
  
  <p>But I can't, 'cause this part of the Ant script is auto-generated. If I right-click the <code>PonyService</code> web service reference and select <em>Edit Web Service Attributes</em> &rArr; <em><code>wsimport</code> options</em>, I can add attributes to the <code>wsimport</code> element, but not child elements.</p>
  
  <p>So: <strong>How do I add the <code>produces</code> child element to <code>wsimport</code> other than hacking the auto-generated Ant script?</strong></p>
  
  <p>Or more generally: <strong>How do I make the NetBeans-generated <code>wsimport</code> <em>not</em> recompile the web service clients every time I build?</strong></p>
  
  <p><em>(Also featured on the <a href="http://forums.netbeans.org/viewtopic.php?p=76756" rel="nofollow noreferrer">NetBeans EE forum</a>.)</em></p>