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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With