jesselong/velocity-maven-plugin — pull request #3 by dpapworth (2012-12-09 21:33:57+00:00)
Title: Release/0.2

I've added an apply-template goal to allow a Velocity template to be applied to a set of files.

The template is passed the following properties

- content - content of the input file
- inputPath - path of the input file (excluding name)
- inputFile - path of the input file (including name)
- outputPath - path of the output file (excluding name)
- outputFile - path of the output file (including name)
- relativePath - relative path of the output file to the output directory

The relativePath is useful for referencing resources external to the template. For example, I can reference JS resources using $relativePath/js/. The path will be substituted as ./js, ../js, ../../js, etc, depending on the directory depth of the output file.

I've also added support for #parse and #include in Velocity (which may be useful to include in the other goal). I've changed the default behaviour on parsing to warn about missing resources, rather than throw an exception.