Application Packaging and deployment has always been an interesting topic for most enterprise java developers. The Java EE 5.0 that became proposed final draft a couple weeks back certain enhancements that may life easier for developers.
The most notable changes are:
Packaging of a deployment descriptor in EAR is optional
We will no longer require packaging an application.xml in an EAR and the container will determine the type of applications based on its name and introspecting its contents. For example, an EAR contains the following modules and does not contain the descriptor:
MyWeb.war and OurCon.RAR will be treated as web and resource adapter modules respectively based on their names.
The container will read the contents of modules with .jar extension (YourEJB.jar, HisClient.jar)
Ability to package library jars at the EAR level
Now we can package common jar files in a standard manner without depending upon proprietary extension supported by application server vendors. You can put common libraries into a library (named lib by default) directory as follows and the classes packaged in the library will automatically available to all modules.
Using library-directory element in the application.xml packaged in the EAR file can customize the name of this lib directory.
Ability to express dependency on Installed JAR files
Either an EAR or modules in an EAR can express dependencies on installed jar files by using the Extension-List as specified for Applet by Java SE specification. If an EAR expresses dependency on an installed jar by using this mechanism then the classes packaged in the JAR will be available to modules in the EAR.
This will address some inconvinience and portability issues with EAR between application server vendors. I wil some other changes in this area in future.