Following a long weekend of getting started with EJB3.0, I spent a while trying to figure out how to share libs across modules in the EAR. I know from searching that this topic has been beaten to death in other forums, but there are new options in Java EE 5 that either haven't been discussed or eluded my search. It seems to be a common source of confusion for J2EE (er, JEE?) developers, especially those just getting started.
I'd like to propose a new Wiki for sharing libs in an EAR, and naturally, I'll volunteer to write it. I found the info I needed eventually, but the existing classloading wikis are a bit overwhelming, and I sense the community would benefit from a concise reference for this simple, common task. According to the latest proposed final draft of Java EE Spec., v5, we should have the following options for accessing shared libraries in an EAR file:
1. Class-Path header in the referencing JAR's manifest file.
2. A .ear file may contain a directory that contains libraries packaged in JAR files. The library-directory element of the .ear file?s deployment descriptor contains the name of this directory. If a library-directory element isn?t specified... the directory named lib is used... All files in this directory (but not subdirectories) with a .jar extension must be made available to all components packaged in the EAR file.
3. A web application may include libraries in the WEB-INF/lib directory.
<module><java>lib/mylib.jar</java></module>to my application.xml.
Is there something new to this topic (ie accessing shared librairies in an ear files) with the latest versions of JBoss AS?
Is one of the first two options available now?