Writing to newcomers-how to automatically copy lib to tomcat in Eclipse/WTP Environment

Source: Internet
Author: User

The following content is transferred from: http://kusix.iteye.com/blog/919887

Veteran and myeclipse users can ignore this article automaticallyArticle 

Many people will find that, although the referenced jar package is set in buildpath, during the deployment of WTP, the jar package is not copied to the WEB-INF/lib. Many people directly copy all jar packages to this directory. I have seen many veterans do the same, but this is not conducive to dependency package management, if the number is small, the version of the dependent package may be chaotic when the number is large (for example, the number of jar packages that my current project depends on is 178.

Here is a solution to this problem.

Generally, our project directory structure is as follows: 

Enter buildpath and select Add userlib to create userlib. For example, seal common as a lib 

Open the. classpath file under the root directory of the project, edit it, and add a dependency attribute to common.

 <  Classpathentry  Kind  = "Con" Path  = "Org. Eclipse. jdt. user_library/common"  >      <  Attributes  >          <  Attribute  Name  = "Org. Eclipse. JST. component. Dependency"  Value  = "/WEB-INF/lib"  />      </  Attributes  > </  Classpathentry  > 

Save, refresh the project, and redeploy the project. You will find that the jar packages managed by these specifications have been deployed under tomcat.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.