Home Thoughts Thought Articles Real-World Experiences With Hibernate - Deployment
Real-World Experiences With Hibernate - Deployment
Written by Ben Teese   
Thursday, 12 April 2007 00:00
Article Index
Real-World Experiences With Hibernate
The Good News And The Bad News
Theory Vs. Reality
Performance
Best Practices
Testing
Debugging
Tools
Annotations
Deployment
Conclusions
All Pages

Deployment

It can be difficult to know which JAR files your particular installation of Hibernate is going to require. Some people just bundle up all of the JARs that come with Hibernate. However, this has a number of problems:
  • It prolongs the time it takes for anybody to check-out your project from CVS
  • It unnecessarily increases the size of your deployment files - for example, your EAR or WAR files.
  • It makes it more difficult for people to setup classpaths in your deployment environment. Admittedly, this will probably be less of a problem with the introduction of Mustang's Class-Path Wildcards, but it's still rather messy.
  • It adds noise to your projects in the form of unnecessary files, making developer's lives just that little bit more difficult.

An alternate approach is to only add what you think you need and see if it breaks at runtime. Whilst this is a commendable alternative to just piling everything in, it can take a long time to do and there's a chance you'll still miss something if you don't test thoroughly.

The Hibernate distribution contains a file called lib/_README.txt. This lists all of the JARs in the distribution, and says under what circustances they are necessary. We have found it very useful for keeping our deployments as small as possible.