Dave
Dave

Reputation: 14178

J2ee packaging - where should 3rd party libs go?

I'm working on an older j2ee project. It runs on JBoss. It deploys various ears and wars. It also requires many jar files in the $JBOSS_HOME/server/default/lib directory. Should those all be moved to the ear and war files?

Upvotes: 3

Views: 139

Answers (2)

jsight
jsight

Reputation: 28409

Every time that I have placed the .jar files in $JBOSS_HOME/server/default/lib, I have ended up regretting it. Unless it just won't work due to strange dependency problems, it's much better to put them in your ear/war.

Upvotes: 1

Eric Petroelje
Eric Petroelje

Reputation: 60498

What you are doing will work fine, but I usually like to put them in the individual EAR/WAR files.

The biggest reason for that is if you have multiple applications that use the same libraries and want to upgrade to a new version for one app, you can do that without affecting the rest of them. This of course is especially important if the new version of the library introduces a breaking change that would then have to be fixed in all your applications rather than just the one that needs the new version.

Upvotes: 2

Related Questions