I am wondering what is the best approach regarding the packaging and deployment of a new enterprise application that
I am working on.
This enterprise application has a web project and an EJB project.
My web project requires some external libraries.
So I have 2 otpions :
1) I either put them in web-project\WebContent\WEB-INF\lib
2) I put them in \jboss-6.0.0.M2\server\default\lib and then add them to the build path of the web-project, under Eclipse
If i use option 1, I of course end up with a somewhat large EAR archive since it contains the external libraries i am using.
Although it's not that big (17 MB).
If I use option 2, the EAR archive is kept at a minimum size.
So I see a matter of size.
Another aspect to take in consideration is the deployment in the production server.
I mean developers are running their own JBoss servers in their respective machines.
One of them will be in charge to generate the EAR archive and deploy it on the JBoss server, in the production server.
So then i am wondering what's best in that case ?
1) To drop the big EAR archive (17 MB) in the deploy folder of the JBoss server (production server)
2) To drop the small EAR archive in the deploy folder of the JBoss server (production server) and update the \jboss-6.0.0.M2\server\default\lib folder (production server)
with the needed libraries as they come along ?
Also, generally, what is an acceptable size for an EAR archive ? I am not aware of any standard or limitation regarding the size.
Maybe there are other ways to do it and that i do not know about.
Option 1 (in both cases) is the typical mechanism used. An alternative with an EAR is to place the library JARs into a lib directory in the EAR. But that usually depends on the JARs - if the JARs are for a UI framework (such a Struts 2), then in the WAR file would be a better location; but if they are utility JARs (such as one of Apache's commons libraries) then the EAR file might be best. JDBC driver JAR files, on the other hand, should go in the common/lib or server/xxx/lib directory.
There are no general guidelines as to WAR or EAR file size. I have seen some huge ones, especially for Grails apps!