Need a tool to compare two .ear files recursively

I am modifying the build process and I need to do a full comparison of the contents of the two .ear files. This means that it compares each archive in .ear recursively. These .ear files have archives containing archives.

I looked at Beyond Compare and Archive Analyzer, but they only do one level at a time. I have to manually deploy each archive. I am looking for something more automatic.

Eclipse and UltraCompare do a binary comparison of two. Which are not what I want.

Is there such a tool?

+8
source share
4 answers

My problem was not just a .ear file extension recursively (I wrote a Java class for this - recursion made it simple.) After the .ear file extension, I have to delimit directories to check for any changes. If nothing but timestamps has changed, then I know that the assembly creates different binary files.

The second problem is that our build process generates hundreds of .xml files, and subsequent builds re-generate these .xml files with elements in a different order. I do not know why. When I expand two .ear files made using reverse assemblies without any changes, diff in the resulting directories shows hundreds of .xml files with diff, although they are functionally equivalent.

In addition to the .ear file extension recursively, I need to diff and exclude the XML files in specific directories. I thought Cygwin diff would do this, but the -exclude switch does not recognize path information:

Cygwin diff will not exclude files if the directory is included in the template

If I cannot find a solution for this, I will write another Java class to go through the entire directory structure, using one diff level in each directory and excluding the .xml files in the corresponding directories.

It feels like I'm reinventing the wheel, but right now I can't find the wheel.

+4
source

zipdiff provides a very good open source solution.

+5
source

In Beyond Compare, go to the Session Settings dialog, and the Handling tab will have the Archive Handling option. If it is installed on As folders always BC, it will process archives in the same way as folders, so it is completely recursive.

+1
source

You can use DevOps tools . This allows you to compare classes within Java JAR archives and display specific differences in class files. The tool performs a deep comparison - it decompiles class files and displays the differences in individual lines of code.

0
source

All Articles