Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding 3rd party jars to WEB-INF/lib automatically using Eclipse/Tomcat

I have a dynamic-web project set up on Eclipse and I'm using Tomcat 7 as my web server. It doesn't seem to be automatically putting 3rd party JARs I add to my library on my build path into the WEB-INF/lib folder. Is there a way I can do this automatically? Every time I search for an answer to this, I find something like this.

So how do I do that automatically? Is there a way to configure my build path to do this?

like image 274
Dave Avatar asked Mar 29 '11 01:03

Dave


People also ask

Where are third party JARs placed?

third party jars, like struts, can be deployed within the WAR (within the WEB-INF/lib directory) of your deployed application EAR. make sure to configure your web. xml file within the WAR with , <servlet-mapping/> and specifics.

How do I add a jar file to my website?

Launch it from a link using Java Web Start. It might be necessary to digitally sign the Jars (what does the app. do?). Note that a 'desktop application' would typically be coded using a JFrame , whereas the equivalent top-level container for embedding is a JApplet .


2 Answers

Here are the instructions for Helios. For earlier releases, see SeanA's answer.

  1. Project Properties -> Deployment Assembly
  2. Add -> Java Build Path Entries
  3. You should now see the list of libraries on your build path that you can specify for inclusion into your finished WAR.
  4. Select the ones you want and hit Finish.
like image 184
Konstantin Komissarchik Avatar answered Sep 19 '22 15:09

Konstantin Komissarchik


You can use "Ant" to copy files to WEB-INF/lib when you deploy files. Using Ant you will be able to copy only those files which have changed.

http://ant.apache.org/manual/Tasks/copy.html

http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-81_basics.htm

like image 39
kensen john Avatar answered Sep 19 '22 15:09

kensen john