使用过滤将Maven插件输出到资源文件 [英] Maven plugin output to recourse file using filtering
本文介绍了使用过滤将Maven插件输出到资源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的资源文件包含:
${project.version}
${dependency.tree}
是否可以用mvn dependency:tree -Dincludes=com.foo.bar
命令输出替换(过滤)${dependency.tree}
属性?
Is it possible to replace (filtering) ${dependency.tree}
property with mvn dependency:tree -Dincludes=com.foo.bar
command output ?
推荐答案
在这里没有简单的出路,但我认为有可能.
No easy way out here, but I think it's possible.
我会这样:
- 将
dependency
插件目标tree
绑定到generate-resources
阶段,并将其配置为将所有内容输出到某个文件(outputFile
选项,请参见此处有关操作方法).这应该在pom.xml中的上一步之后进行,并绑定到generate-resources
阶段. - 使用
resources
插件+过滤实现目标.
- Bind
dependency
plugin goaltree
execution togenerate-resources
phase and configure it to output everything to some file (outputFile
option, see here). - Use
gmaven
plugin to load this file into adependency.tree
property (see my answer here on how to do it). This should go after the previous step in pom.xml and be bound togenerate-resources
phase. - Use
resources
plugin + filtering to achieve the goal.
这篇关于使用过滤将Maven插件输出到资源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文