0

I have an ear file which includes war files and jars. I'm using the unzip task to unzip the ear. the problem is that I want to see in my destination folder the war files etracted as well. for eample: I have c:\example.ear inside i have 1.jar, 2.jar 3.war, 4.war after extractio I would like to see:

c:\exmple
  3.war (d)
  4.war (d)
  1.jar (f)
  2.jar (f)

when d=directory f=file

soninob
  • 428
  • 11
  • 22
  • A war file is a zip file too. So unzip it, the same way you unzipped the ear. – JB Nizet Dec 25 '17 at 14:17
  • I tired it, the different is that an ear is one file wich I can set src and dest. after extraction I can use unzip again with fileset, but then I'm getting all of the files unziped in under the parent folder. I would like to keep the name of the war as the name of the nested directory. – soninob Dec 25 '17 at 14:47
  • You probably want to use the ant-contrib's foreach task. https://stackoverflow.com/questions/1467991/ant-how-to-execute-a-command-for-each-file-in-directory – JB Nizet Dec 25 '17 at 15:07

1 Answers1

0

well, apperantaly you cannot create a folder with the same name of a war file in the same location. So what I did in the end was move the war file to a tmp folder and unzip from there to the previous location. solve the trick :-)

soninob
  • 428
  • 11
  • 22