Is there a way to compare two Java war files

We created some war files for our web server some time ago and now rebuilt them.

To make sure that nothing has changed (and as a quality check), we tried to compare them using WinMerge. The differences we can see look as if they are associated with some metadata, for example. files created on different dates?

The difference in the lines seems consistent, for example.

"d} <

and

Β³Ze <

Military files are still the same size.

Is there a way to compare them that removes metadata like date?

+3
source share
6 answers

WAR - Zip. ? , WAR . , , .

+7

, , .

Windows jar, jdk

jar -xvf xxxx.war

WinMerge .

,

+6

eclipse jar/war. http://www.javalobby.org/java/forums/m91839415.html

. Indigo, , jar, jar, , .

+6

2 . , 2 Java WAR.

$ sdiff --width 160 \
   <(unzip -l -v my_num1.war | cut -c 1-9,59-,49-57 | sort -k3) \
   <(unzip -l -v my_num2.war | cut -c 1-9,59-,49-57 | sort -k3)

:

--------          -------                                                       --------          -------
Archive:                                                                        Archive:
-------- -------- ----                                                          -------- -------- ----
48619281          130 files                                                   | 51043693          130 files
    1116 060ccc56 index.jsp                                                         1116 060ccc56 index.jsp
       0 00000000 META-INF/                                                            0 00000000 META-INF/
     155 b50f41aa META-INF/MANIFEST.MF                                        |      155 701f1623 META-INF/MANIFEST.MF
 Length   CRC-32  Name                                                           Length   CRC-32  Name
    1179 b42096f1 version.jsp                                                       1179 b42096f1 version.jsp
       0 00000000 WEB-INF/                                                             0 00000000 WEB-INF/
       0 00000000 WEB-INF/classes/                                                     0 00000000 WEB-INF/classes/
       0 00000000 WEB-INF/classes/com/                                                 0 00000000 WEB-INF/classes/com/
...
...

, , .

+3

"Beyond Compare"... ( ) , , .

0

WinMerge zip (, ,.WAR ), 7zip WinMerge. , , , .dll ... , , . , 9.20 .

Althoug , winmerge , .class . , anydiference. , .

0

Source: https://habr.com/ru/post/1738899/


All Articles