将XML文件与Maven或ant进行比较

编程入门 行业动态 更新时间:2024-10-23 15:29:50
本文介绍了将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.

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

But if it were that simple, to just run a command line, check out mojo.codehaus/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进行比较

本文发布于:2023-10-23 14:01:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1521030.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   XML   ant   Maven

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!