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

天涯浪子 提交于 2019-12-10 18:15:08

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/3375279/is-there-a-maven-plugin-that-can-diff-files-and-output-the-result-to-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!