问题
I have resource file containing:
${project.version}
${dependency.tree}
Is it possible to replace (filtering) ${dependency.tree}
property with mvn dependency:tree -Dincludes=com.foo.bar
command output ?
回答1:
No easy way out here, but I think it's possible.
I'd do it this way:
- 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.
来源:https://stackoverflow.com/questions/13718845/maven-plugin-output-to-recourse-file-using-filtering