Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a maven plugin that can diff files and output the result to file?

I've been working on integration-tests for a Java web service. The integration test now sends SOAP-requests to the server which are asserted via the SoapUI-plugin and for each of the SOAP-requests an xml file is produced and saved (a part of the integration-test phase).

Is there a plugin that allows me to diff the xml files that has been output and saved against a similar set of xml files that were produced in an earlier run? The idea is to diff xml files output from the previous release version with the current version to make sure the expected changes have been made to the xml files.

I hope my question is clear enough. Thanks in advance

EDIT: The xml files that I would like to compare against will be copied in to a directory (lets say, target/compare_against) by the person that is running the test. They are not under SCM.

like image 266
John Avatar asked Jan 01 '26 22:01

John


2 Answers

The only plugin that will do diffs “natively” is the scm plugin, and that only if you've got the other version of the file committed to a repository. (I say “natively” because it probably just runs the diff in a subprocess internally anyway.) I mention this because your question wasn't really clear about how you were keeping around the data from the previous runs.

If that doesn't fit, you'll find the antrun plugin easiest.

like image 159
Donal Fellows Avatar answered Jan 06 '26 10:01

Donal Fellows


I haven't seen any Maven plugins that will do it. You might be able to find an Ant Task (maybe this one?) to do it and use the antrun plugin to run the task. I did see some stuff about xmldiff and Maven/Ant integration but, it's kind of bare.

like image 29
Corv1nus Avatar answered Jan 06 '26 09:01

Corv1nus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!