English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

SpringBoot Packaging

in J2EE applications, modules are packaged as JAR, WAR,and EAR . J2EE uses compressed file format. J2EE defines three types of archives:

War JAR EAR

WAR

WAR Represents Web archive.. The WAR file represents a Web application. The web module contains servlet classes, JSP files, HTML files, JavaScript, and others, and is packaged as a file with the extension. war JAR file. It contains a file named WEB-INF special directories.

WAR is a module that can be loaded into the web container of a Java Application Server. The Java Application Server has twoContainer: Web containerand EJB Container.

Web containerHosting Web applications based on Servlet API and JSP. The web container requires the web module to be packaged as a WAR file. This is a JAR file specifically for WAR files, located in WEB-INF The folder contains web.xmlv File.

EJB Containerhosts Enterprise Java Beans based on the EJB API. It requires packaging the EJB module into a JAR file. It is in META-INF The folder contains a ejb-jar.xml File.

The advantages of a WAR file are that it can be easily deployed. On client computers in the Web server environment. To execute a WAR file, a web server or web container is required. For example, Tomcat, Weblogic, and Websphere.

JAR

JAR Represents Java Archive.The EJB (Enterprise Java Beans) module, which contains Bean files (class files), manifests, and EJB deployment descriptors (XML files), is packaged into a JAR file with an extension of jar.Software developers can distribute Java classes and various metadata.

In other words, a file that encapsulates one or more Java classes, manifests, and descriptors is called a JAR file. It is the lowest level of an archive. It is in the J2EE used to wrap EJB and client Java applications.

EAR

EAR Represents Enterprise Archive.. The EAR file represents an enterprise application. The two files are packaged into an extension named ear JAR file. It has been deployed to the application server. It can contain multiple EJB modules (JAR) and Web modules (WAR). This is a special JAR, which in META-INF The folder contains a application.xml File.