0

My project is very huge and there are more than hundrends of wars and jars after maven build. But only a few of them are modified to update. I need a way to update those new wars and jars while leave others as old.

At first i wanted to use MD5 to tell them out. but I found that even two jars ( or wars ) compressed some same files, the MD5 value of them are different. So is there any other method to judge which jars and wars should i upload to server to update? Or how can i treat two jars as one if the files in them are identical?

Sheldon Wei
  • 1,198
  • 16
  • 31
  • Possible duplicate of [Maven building only changed files](http://stackoverflow.com/questions/15405413/maven-building-only-changed-files) – kdoteu May 18 '16 at 08:49

1 Answers1

0

finally a way came up to me.

I computed the md5 value of each non-jar file, and compare it with its former value; for jar-like file, including war and zip, i use the jdk class java.util.zip.ZipFile to compute the md5 of each file inside.

i put the md5 values into a sorted list and compute the md5 value of the string presentation of the list.

so that's it!

Sheldon Wei
  • 1,198
  • 16
  • 31