Reputation: 611
I have a sample.ear file and I want to replace a particular file inside sample.ear.
consider ear file sample.ear which content com1/test1/file1.sh and com2/file2.sh
here I want to replace file1.sh with updated file file1.sh using unix.
I am using jar command but i am not able to replace the file in subdirectories
Thanks
Upvotes: 5
Views: 8815
Reputation: 785856
Use:
jar -xf sample.ear com1/test1/file1.sh
to extract file.sh
. Once you are done modifying this com1/test1/file1.sh
file use:
jar -uf sample.ear com1/test1/file1.sh
to update the archived ear with the modified file.
Use jar --help
for detailed help.
Upvotes: 6