Fork me on GitHub


This document is intended to provide instructions for using the Directory Content Maven Plugin.

In order for this discussion to be useful, it's critical to cover two topics:

  1. Configuring your project's pom.xml to run the plugin during the project's build cycle
  2. Invoking the plugin from the command-line

Configuring Plugin

By tying the goals of the plugin to a phase in the build cycle, the specified goals will run each time that phase of the build cycle is executed. Doing this can make it easier to add the plugin to your project, because it eliminates the need to run the plugin standalone.

To bind a goal of the Directory Content Maven Plugin to a phase in the build cycle, you will need to add the execution tag with the goal set to goal name (e.g transformList). Optionally, you can bind the plugin to a different build phase by using the phase option. For instance, using process-sources in the phase option will force the transformList goal to run each time this phase of the build cycle occurs.

For a complete list of the available configuration options see goal overview page.

Example for the transformList goal:

                  <phase>process-sources</phase> <!-- When omitted defaults to 'generate-sources' -->
                     <!-- put your configurations here -->

If you want to use snapshot, then you need to add the repository to your pom.xml:

      <name>Sonatype's SNAPSHOT repository</name>

Invoke from the command-line

The goals for the Directory Content Maven Plugin are bound to their respective phases in the build lifecycle. So to compile your sources, you need only to tell Maven until which lifecycle to execute.

The following will transform directory files list (see configuration in previous section):

mvn process-sources

You can also transform directory files list by execute only this plugin:

mvn biz.gabrys.maven.plugins:directory-content-maven-plugin:transformList