Help Needed in editing the war file
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Dear All,
I am trying to automate the build and deployment process in my project. Currently build.xml generates the war file and I have updated the script to copy the war file to the required destination in the linux environment. But before transferring the war file to the linux server, I need to explode the war file and edit few of the configuration files and pack them back to the war file. Hence request you all to help me or guide to update my ant script (build.xml) to achieve my above requirement.
Please do the needful.
Thanks in advance.
I am trying to automate the build and deployment process in my project. Currently build.xml generates the war file and I have updated the script to copy the war file to the required destination in the linux environment. But before transferring the war file to the linux server, I need to explode the war file and edit few of the configuration files and pack them back to the war file. Hence request you all to help me or guide to update my ant script (build.xml) to achieve my above requirement.
Please do the needful.
Thanks in advance.
Cheers,
Keerthi Kumar N
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
This seems backwards. Why are you creating the war file before all its constituent parts are available?
Keerthi Kumar
Ranch Hand
Posts: 105
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
The problem is, the generated war file is of from the default entries, which I am not supposed to edit it before the generation of the war file. I am supposed to edit the war file after the successful build.
The problem is, the generated war file is of from the default entries, which I am not supposed to edit it before the generation of the war file. I am supposed to edit the war file after the successful build.
Cheers,
Keerthi Kumar N
Ulf Dittmer
Rancher
Posts: 43081
77
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I would question that, as it doesn't seem to make sense. But regardless, a war file is just a zip file with a different extension, so you can use the unzip/unwar task to extract its contents, edit them to your heart's content, and finally war them back together.
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi keerthi,
The following steps for edit and update the war file content in linux
1. Just right click your war file.
2. Select 'open archive manager'
3. Then which file you want to edit, just open that file and edit the content.
4. Then system ask to update or cancel, when you close that archive manager dialog box.
I hope , its useful for u.
The following steps for edit and update the war file content in linux
1. Just right click your war file.
2. Select 'open archive manager'
3. Then which file you want to edit, just open that file and edit the content.
4. Then system ask to update or cancel, when you close that archive manager dialog box.
I hope , its useful for u.
Wake up! Don't let your smile be snatched away by anybody!
Regards, Eswar
Keerthi Kumar
Ranch Hand
Posts: 105
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Eswar,
Thanks a lot for your reply. Could you please help me out to carry out the above steps through the ant build script!! I need to automate the build process. Hence I need to update my build.xml file to accomplish the above tasks specified by you.
Thanks a lot for your reply. Could you please help me out to carry out the above steps through the ant build script!! I need to automate the build process. Hence I need to update my build.xml file to accomplish the above tasks specified by you.
Cheers,
Keerthi Kumar N
Ulf Dittmer
Rancher
Posts: 43081
77
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
After having read the documentation of the unwar/unzip Ant tasks, what, specifically, is unclear about how to do this?
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Actually, I design all my webapps so that you don't have to edit the war file. The exact same byte-for-byte copy of the WAR serves for local testing, Beta testing, and production. I do this by defining the variable parts of the webapp as externally-injectable resources that can be retrieved via JNDI. The database location info comes that way naturally, since I always use server-pooled DataSources, but I also use external resource definitions to specify where file upload directories are, locations of server-specific property files, and so forth.
It makes the program design slightly more complex, but keeps the build simple. Just as importantly, it ensures that the wrong copy of a WAR doesn't get deployed and have Production updating a Test database or vice versa. Since there's only one copy, it's never the "wrong" one.
It makes the program design slightly more complex, but keeps the build simple. Just as importantly, it ensures that the wrong copy of a WAR doesn't get deployed and have Production updating a Test database or vice versa. Since there's only one copy, it's never the "wrong" one.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
| There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |











