问题
I have a requirement to compare 2 directories of wsdl and xsd files using maven or ant and to generate a report (preferably html) of the differences.
Any recommendations?
回答1:
I would write your own Plugin. Start with this on the command line:
mvn archetype:generate -DgroupId=mygroup -DartifactId=myartifact
Choose maven plugin from the list. A plugin project will be generated.
The plugin code will have an execute()
method, just implement that. It will be far faster and cleaner to implement this simple method than to hack around with the Ant plugin. For instance, using normal process exec semantics, you could run a recursive diff of the two directory trees. Whatever you would do from the command line.
But if it were that simple, to just run a command line, check out http://mojo.codehaus.org/exec-maven-plugin/index.html first to see if that will solve your problem. Note that this plugin is not generally portable across operating systems though. Writing your own plugin is generally preferred for this reason.
You can add this new plugin project to your source tree, Maven will know to build the plugin first.
来源:https://stackoverflow.com/questions/4617785/compare-xml-files-with-maven-or-ant