aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes creating same file twice -  size differs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "creating same file twice -  size differs" Watch "creating same file twice -  size differs" New topic
Author

creating same file twice - size differs

Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
I am using ant script to create war file.

While creating same war file twice I find that the sizes of the resultant war files are different.

Is there a way by which this issue can be fixed.

Kind Regards,
Joshua


SCJP,SCWCD, Into ATG now!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
In what way do the files differ? Surely, if the overall size is different, then there must be at least one file inside of it that has a different size?


Ping & DNS - my free Android networking tools app
Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
The length is same. I tested it by printing the length in the standard output.

I used a folder comparison software to find exactly where things went wrong.
It showed that the content of jar file was a mismatch.
So I extracted the jars and then compared it again but the extracted files did not have any difference.

So I guess the problem lies on the archiving task of ant i.e <jar>.
So Is there any way by which I can get consistent ouput for the same.

Kind Regards,
Joshua
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
You need to identify exactly what is different about them.

If the difference is the time the file was created, then you can never make them exactly the same.

Some file/folder compare softwares include the time/date in their compare. Some of these software allows to exclude in the compare process, the time/date factor.
 
jQuery in Action, 2nd edition
 
subject: creating same file twice - size differs