Reputation: 581
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.
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:
In both case I mark the libraries as exported in the "Order and Export" tab of the Java Build Path
When I publish the corresponding server that uses Tomcat 7.0.041 or export the war I end with the follwing scenarios:
When starting the server a ClassNotFoundException is thrown in both scenarios for classes residing in lib1.jar or lib2.jar.
Is there any way to deploy the libs needed for the Web Fragment project without putting them manually in the main project?
Upvotes: 1
Views: 1940
Reputation: 581
I have just found a two step answer to my question.
In the scenario #1 above after doing it you have to go the Web Fragment project properties and then go to Deployment Assembly, press the "Add" button, select Java Build Path Entries and select all the libraries you want to be included in the WEB-INF/lib directory of the server.
Once this is done the libraries selected will be copied to the WEB-INF/lib when publishing the server or exporting the war.
Upvotes: 2