문제

I'm modifying a build process and I need to do a complete comparison of the contents of two .ear files. That means recursively comparing each archive in the .ear. These .ear files have archives that contain archives.

I've looked at Beyond Compare and Archive Analyzer, but they only do one level at a time. I have to manually drill down into each archive. I'm looking for something more automatic.

Eclipse and UltraCompare do a binary comparison of the two .ears which is not what I want.

Does such a tool exist?

도움이 되었습니까?

해결책 2

My problem turned out to be more than just expanding the .ear file recursively (I wrote a Java class to do that - recursion made it simple.) Once the .ear files are expanded I have to diff the directories to check for any changes. If anything other than timestamps changed then I know that the build is producing a different binary.

The second problem is that our build process generates hundreds of .xml files and subsequent builds re-generate those .xml files with the elements in different order. I'm not sure why. When I expand two .ear files made by back-to-back builds with no changes to anything the diff of the resulting directories shows hundreds of .xml files with diffs, even though they are functionally equivalent.

In addition to expanding the .ear files recursively I need to do a diff and exclude the .xml files in certain directories. I thought that Cygwin diff would do this, but the --exclude switch doesn't recognize any path information:

Cygwin diff won't exclude files if a directory is included in the pattern

If I don't find a solution to this I'll write another Java class to step through the whole directory structure doing a single level diff in each directory and excluding the .xml files in the appropriate directories.

I have the feeling that I'm re-inventing the wheel, but I can't find a wheel right now.

다른 팁

zipdiff provides a very good open source solution.

In Beyond Compare go into the Session Settings dialog, and on the Handling tab is an Archive Handling option. If it's set to As folders always BC will treat archives just like folders, so it's fully recursive.

you can use DevOps-tools. It allows comparing of classes inside Java JAR archives and displaying specific differences in class files. The tool performs deep comparison - it decompiles the class files and displays differences in specific code lines

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top