Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java webapp deployment: explode or not to explode?

A very simple question. I have a .war(~40MB) file to be run on JBoss. What is the best practice for deployment: Should the war file be deployed in exploded format? Or not?

I ask because if its exploded then I've a choice of updating my properties file anytime I choose to (and need not make a new war every time I change the properties file).

But I'm not sure if deploying a war in exploded format is the best practice.

Please help me realize. :)

like image 789
pavanlimo Avatar asked Jul 15 '11 07:07

pavanlimo


People also ask

What is exploded deployment?

An exploded deployment is an application which is not packaged in a . war, . ear or . jar file but it's contained in a directory using these extensions (. ear, .

What is the difference between WAR and WAR exploded?

There is no difference really. An exploded archive is a tree of folder and files that respects a given structure which your application server can exploit to deploy the application. For a web application for instance, you create a war directory structure.

What is exploded WAR in Intellij?

Using exploded deployment allows updating application without redeploying or restarting the server. The server doesn't need to unpack the web application when it's deployed, it just uses the files that are present in the directory.


1 Answers

Should the war file be deployed in exploded format? Or not?

This would depends on several factors:

  • Will you require that application-server administrators modify the contents of the WAR file after deployment? If the answer is yes, especially in the cases where property or configuration files are concerned, then you ought to be using an exploded format. This would make it easier to make changes in the files, without requiring a redeployment of the complete WAR file.
  • How do you propagate changes to production? If you are not pre-compiling your JSP files, and if you are intending to deploy newer versions of JSPs by copying them over to the area containing the exploded WAR file, then it is quite obvious that re-deploying a huge WAR file is not an optimal solution. However, do note that this would depend on your deployment practices. Often, it is easier to audit that the WAR file in production is a replica of a generated build from version control, with a single hash of the WAR file. If you deploy incremental changes, you will find that hashes will be required for every file deployed.
  • How soon do you want your application to be deployed and made available? This point is trivial, but there are enough instances of applications that take several minutes to start because the application server is busy exploding the WAR file and recreating the necessary artifacts. This could lead to significant downtime, if the behavior of the server is to explode the WAR file on every restart of the application server. Since I am unaware of the behavior of JBoss or the specific version in question, I would suggest that you verify this on your own, to ensure that you can limit downtime to an acceptable level.
like image 87
Vineet Reynolds Avatar answered Oct 08 '22 02:10

Vineet Reynolds