title: How can I have Netbeans automatically copy 3rd party jars from an included class-library to my project's dist/lib directory?
body: <p>I have a Java Application in NetBeans 7.1 (let's call it myApp) that depends on a Java Class-Library Project [more than one, actually] where I keep some utility-classes I share among projects.</p>
  
  <p>This Class-Library Project (let's call it myLib) depends on [many] third party libraries (e.g. apache-commons-younameit.jar).</p>
  
  <p>I included myLib as a library, and NetBeans' Ant script pulls myLib.jar in the <code>dist/lib</code> directory of my myApp project; however, the jars upon which myLib depends are not pulled in together with myLib, so my project gets runtime exceptions due to the missing apache-commons-youtnameit.jar.</p>
  
  <p>I would like to have both myLib.jar and apache-commons-younameit.jar automatically pulled into myApp's <code>dist/lib</code> folder, so that I don't have to manually check all of my libraries' dependencies and add them to my main project.</p>
  
  <ul>
  <li><strong>Is there an obvious way to accomplish this through NetBeans dialogs that I'm missing?</strong></li>
  <li><strong>or is it necessary to manually tweak my build.xml? If so, could you kindly post an example?</strong> (I'm not that well up on Ant)</li>
  </ul>
  
  <p>What I'd like to <strong>avoid</strong> is the following:</p>
  
  <ol>
  <li>I need to add a new utility library, picking from my Java Class-Library Projects.</li>
  <li>I lookup into that library's libraries what jars are used and write them down.</li>
  <li>I go back to my main project and add those 3rd party libraries (only the ones that I haven't included already for direct use from within my main project itself).</li>
  </ol>
  
  <p>Thank you in advance for any help, or for pointing me in the right direction.</p>