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

此生再无相见时 提交于 2019-11-26 16:01:50

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.

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

I haven't tried this personally, but what I believe it does is what I think you are looking for:

  • Right-click project -> Properties
  • Go to Java EE Module Dependencies
  • Check the boxes for the JARs that you want to export with your Web Application

Let me know if this automatically puts them in your exported WAR. I always just add mine to WEB-INF/lib :)

Instructios for Eclipse Indigo (version 3.7.2)

  • Project Properties -> Deployment Assembly
  • Add -> Archives From File System -> Next -> Add
  • (The file dialog of your system opens up.)
  • Navigate to the archive you want to include in your WEB-INF/lib, select it and hit OK.
  • Hit Finish.
  • Hit OK.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!