tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Ruthenbeck <>
Subject Re: Best practice question: where to place project libraries
Date Wed, 11 Feb 2004 00:41:07 GMT

Forgot to mention...

At 04:36 PM 2/10/2004, you wrote:
>At 04:16 PM 2/10/2004, you wrote:
>>I need servlet-api.jar to compile my project. I may need some of the 
>>commons-beans stuff in the future. Should I put these libs in my 
>>projects lib folder (and then in the war) or should I rely on the 
>>tomcat versions? If the latter, which jar will be used, and what should 
>>I do if I deploy to a different container?
>>I'm leaning toward duplicating the libraries (this removes an 
>>environment dependancy, too), but I'd like some advice.
>As a general rule, strive to keep your webapp self-contained and 
>autonomous with only J2EE-standard dependencies (things like JNDI 
>objects that are configurable in every container).  Unless there's a 
>reason not to (JDBC drivers is one common one), package your own 
>dependent libraries with your app -- it frees you from versioning 
>problems (maintaining the correct library versions for your app over 
>time) and makes migration between containers much easier.
>If you're actively supporting multiple containers, it's practically 

Libraries such as servlet-api.jar will be provided by each vendor and 
shouldn't be included in the distribution (use it to compile, but at 
runtime, rely on your container to provide those interfaces).  Including 
something like servlet-api.jar in your distro will get messy.  3rd-party 
libraries (such as commons-*) should be included since they're really 
part of your app -- not the container.


Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential. See:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message