Intro to JARs, WARs, SARs, RARs and EARs
Anyone worth calling oneself a java developer would know what a JAR file is. It’s an archive, just like ZIPs and TARs are. In addition to being a simple archive, a JAR file can store some very useful meta information about its contents. A special file, META-INF/MANIFEST.MF is where a jar records meta information.
EJBs are packaged as jar files as well, albeit with one or more special files under META-INF, called deployment descriptors.
A WAR file packages a web application. What does a web application consist of? It consists of
- Additional files such as java servlets, utility classes and jars for use in servlets/JSPs and deployment descriptors that should not be reachable via URLs.
The latter are stored under a special folder named WEB-INF. Both are then archived in JAR whose extension is modified as WAR to distinguish it as a java web application.
Similarly, RAR files are JAR files used to package resource adapter modules as defined under the J2EE Connector Architecture (JCA) and SAR files are the ones used to package JMX-enabled services in JBoss.
Just as all rivers are destined to go merge with the sea, all these archives that relate to a single enterprise application may be packaged under one EAR.