title: Deploying libraries in Web Fragment projects in Eclipse
body: <p>Using Eclipse 4.2 I am trying to deploy a web application that consists in a main Dynamic Web project and a Web Fragment project.</p>
  
  <p>The Web Fragment needs some jar libraries (lib1.jar and lib2.jar) that are not needed at compile time by the main project. To add these libraries I have two options:</p>
  
  <ol>
  <li>Put them in the Java Build Path each one has a single entry</li>
  <li>Put them in a WEB-INF/lib folder under the src folder and add a "Web App Libraries" library to the Java Build Path</li>
  </ol>
  
  <p>In both case I mark the libraries as exported in the "Order and Export" tab of the Java Build Path</p>
  
  <p>When I publish the corresponding server that uses Tomcat 7.0.041 or export the war I end with the follwing scenarios:</p>
  
  <ol>
  <li>In case 1 no library (lib1.jar neither lib2.jar) is copied to the main WEB-INF/lib folder</li>
  <li>In case 2 both libraries are copied inside the WEB-INF/lib folder of the web fragment generated jar file which in turn is copied to the main WEB-INF/lib folder.</li>
  </ol>
  
  <p>When starting the server a ClassNotFoundException is thrown in both scenarios for classes residing in lib1.jar or lib2.jar.</p>
  
  <p>Is there any way to deploy the libs needed for the Web Fragment project without putting them manually in the main project?</p>