Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strategies for deploying an exploded ear

Tags:

java

jboss

ant

I have a build process that creates an ear in a fairly complicated manner (multiple EJB jars, a couple of wars, a couple of sars (which are JBoss specific). The ant process for piecing this together is somewhat complex.

What is the best strategy to not recreate the creation logic of the ejb creation in ANT but still be able to deploy exploded to the application server or in an ear for QA and production.

Although I'm concerned about JBoss, the question is really relevant to any application server that supports exploded ear deployment, and is really more about ANT, how to avoid two different targets that recreated the logic of creating a zip file vs copying to a directory.

like image 718
Yishai Avatar asked Dec 18 '22 04:12

Yishai


1 Answers

I've found that what works best for us, is to create the ZIP/EAR/WAR/JAR contents in exploded form in the file system, and then as the final step zip/ear/war/jar it up to a file.

This allows us to have post processing steps which only knows of files and not zip-file entries, which is usually much simpler. If you work with an exploded deployment and a server which picks up changed files in the exploded deployment, you can simply use rsync to update only those files actually changed in the server deployment.

You would then have the building in one target, and packing in another, making it easy to do both.


See Alexander Pogrebnyak's answer in regards to how to handle manifests using this solution.

like image 90
Thorbjørn Ravn Andersen Avatar answered Jan 01 '23 23:01

Thorbjørn Ravn Andersen