tags:

views:

56

answers:

2

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?

+2  A: 

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.

Eric Petroelje
+1  A: 

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.

jsight