EAR (file format)
EAR (Enterprise Archive) is a file format used by Jakarta EE for packaging one or more modules into a single archive so that the deployment of the various modules onto an application server happens simultaneously and coherently. It also contains XML files called deployment descriptors which describe how to deploy the modules.[1] Ant, Maven, or Gradle can be used to build EAR files. File structureAn EAR file is a standard JAR file (and therefore a Zip file) with an .ear extension, with one or more entries representing the modules of the application, and a metadata directory called
ModuleDevelopers can embed various artifacts within an EAR file for deployment by application servers:
Class isolationMost application servers load classes from a deployed EAR file as an isolated tree of Java classloaders, isolating the application from other applications, but sharing classes between deployed modules. For example, a deployed WAR file would be able to create instances of classes defined in a JAR file that was also included in the containing EAR file, but not necessarily those in JAR files in other EAR files. One key reason for this behavior is to allow complete separation between applications which use static singletons (e.g. Log4J), which would otherwise confuse the configuration between separate applications. This also enables different versions of applications and libraries to be deployed side by side. The JBoss application servers before Version 5 were notable in that it does not isolate deployed components. A web application deployed in one EAR file would have access to classes in other EAR and WAR files. This is a somewhat controversial policy. The Unified Classloader design reduces communications overhead between running applications, as class data can be shared by reference or simple copies. It also allows developers to avoid having to understand the problems that a tree of classloaders can create. However, it prevents different versions of dependent libraries from being deployed in separate applications. JBoss 4.0.2 switched to a hierarchical classloader, but in version 4.0.3 it reverted to a Unified Classloader for backwards compatibility reasons. There is now a configuration option to change this behavior. JBoss 5.x, 6.x and 7.x no longer use Unified Classloading.[2] META-INF directoryThe
Each Next to the Jakarta EE deployment descriptor there can be zero or more runtime deployment descriptors. These are used to configure implementation-specific Jakarta EE parameters.[2] See alsoReferences
External links |
Portal di Ensiklopedia Dunia