Maven plugin output to recourse file using filtering

雨燕双飞 提交于 2020-01-06 07:24:10

问题


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:

  1. Bind dependency plugin goal tree execution to generate-resources phase and configure it to output everything to some file (outputFile option, see here).
  2. Use gmaven plugin to load this file into a dependency.tree property (see my answer here on how to do it). This should go after the previous step in pom.xml and be bound to generate-resources phase.
  3. Use resources plugin + filtering to achieve the goal.


来源:https://stackoverflow.com/questions/13718845/maven-plugin-output-to-recourse-file-using-filtering

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!