What you do will work fine, but I usually like to put them in separate EAR / WAR files.
The biggest reason for this is if you have several applications that use the same libraries and want to upgrade to a new version for one application, you can do this without affecting the rest. This, of course, is especially important if the new version of the library introduces a change that should be fixed in all your applications, and not just the one that needs the new version.
source
share