将XML文件与Maven或ant进行比较 [英] compare xml files with maven or ant

查看:62
本文介绍了将XML文件与Maven或ant进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要比较wsdl和xsd文件的2个目录 使用Maven或ant并生成以下内容的报告(最好是html) 差异.

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.

有什么建议吗?

推荐答案

我会编写自己的插件.从命令行开始:

I would write your own Plugin. Start with this on the command line:

mvn archetype:generate -DgroupId=mygroup -DartifactId=myartifact

从列表中选择Maven插件.将会生成一个插件项目.

Choose maven plugin from the list. A plugin project will be generated.

插件代码将具有一个execute()方法,只需实现即可.实现这种简单方法要比使用Ant插件来窃取要快得多,也更干净.例如,使用正常的流程执行语义,您可以运行两个目录树的递归差异.无论您从命令行执行什么操作.

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.

如果那么简单,只需运行命令行,请查看首先查看http://mojo.codehaus.org/exec-maven-plugin/index.html 能否解决您的问题.请注意,尽管如此,该插件通常不能跨操作系统移植.因此,通常最好编写自己的插件.

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.

您可以将此新插件项目添加到您的源代码树中,Maven会知道首先构建该插件.

You can add this new plugin project to your source tree, Maven will know to build the plugin first.

这篇关于将XML文件与Maven或ant进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆