0

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 ?

xlecoustillier
  • 16,183
  • 14
  • 60
  • 85
Mihhail
  • 21
  • 1

1 Answers1

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.
Community
  • 1
  • 1
Andrew Logvinov
  • 21,181
  • 6
  • 52
  • 54
  • Thank You. I used solution 1. It's a little bit easier to parse then 3., but both works fine for me – Mihhail Dec 05 '12 at 13:46