asciidoctor/asciidoctor-maven-plugin — pull request #120 by abelsromero (2014-08-27 21:59:04+00:00)
Title: Added new parameters preserveDirectories and relativeBaseDir to preserve source folder structure

In order to fully fix https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/99 and the issues commented by @nobeh this PR adds 2 new parameters to the plugin:
- preserveDirectories: allows to specify that the rendered documents must be stored in the same folder structure as found in the source directory (default: false). This fixes
- relativeBaseDir: only used when baseDir is not set, allows to specify that each AsciiDoc file must search for its resources in the same folder (tested with include:). That is, it sets baseDir to the same as the AsciiDoc source file. (default: false)

Both parameters are false by default so that backward compatibility is assured.

Additionaly:
- test are provided for the main use-cases.
- Zip mojo has been tested and is compatible with the changes, so that the generated zip retains the source structure. Other mojos haven't and I suspect that Http will ignore them.
- additional tests to validate source highlighting are included.

possible TODOs:
- the changes were made avoiding major changes, on other words, it's not as modular and eficient as I would like :(, but some big refactoring is needed for that, and that refactor would affect also the other mojos.
- Adding a regEx parameter to filter resouces that are not wanted in the outputDirectory, now all but AsciiDoc documents are copied.

If the PR is accepted I can send another later updating the readme.

As a side note, my main motivation for this was providing the tools to mix AsciiDoc documents with source code so that they easily co-exist. Each package can contain 1 or more AsciiDocs that reference/include the production code and, if necessary, since no absolute paths are required, refactorig can be easily done in both, code and AsciiDoc.