问题
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
dependencyplugin goaltreeexecution togenerate-resourcesphase and configure it to output everything to some file (outputFileoption, see here). - Use
gmavenplugin to load this file into adependency.treeproperty (see my answer here on how to do it). This should go after the previous step in pom.xml and be bound togenerate-resourcesphase. - Use
resourcesplugin + filtering to achieve the goal.
来源:https://stackoverflow.com/questions/13718845/maven-plugin-output-to-recourse-file-using-filtering