Usage

Running Plugin

The following will run the main goal of the plugin from the command line:

mvn org.hedgecode.maven.plugins:classpath:classpath

or a shorter version:

mvn classpath:classpath

For running the goals of the plugin in a shorter version, your Maven configuration file (~/.m2/settings.xml) must contain the following lines:

<pluginGroups>
    <pluginGroup>org.hedgecode.maven.plugins</pluginGroup>
</pluginGroups>

It should be noted that the run of classpath goal of this plugin separately  from the other phases of the Maven lifecycle will not bring  any expected changes in the project, because plugin focuses on use in the conjunction with the other phases.

In other words, the use of this plugin is recommended in generate-resources phase, which precedes the phase compile. Plugin configuration for such use are presented in the next paragraph:

Configuring Plugin

Below shows a template of plugin configuration for use on stage, corresponding the phase generate-resources, with indication of available configuration options (in a boolean parameters specify default values):

<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.hedgecode.maven.plugins</groupId>
                <artifactId>classpath-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>build-classpath</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>classpath</goal>
                        </goals>
                        <configuration>
                            <path>...</path>
                            <paths>
                                <path>...</path>
                                ...
                            </paths>
                            <isMask>true</isMask>
                            <withSubDir>false</withSubDir>
                            <assignProjectClasspath>true</assignProjectClasspath>
                            <overlapDependencyMatch>false</overlapDependencyMatch>
                            <outputFile>...</outputFile>
                            <outputProperty>...</outputProperty>
                            <errorIsEmptyPath>false</errorIsEmptyPath>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            ...
        </plugins>
    </build>
    ...
</project>

Note: Maven 3.0 will issue warnings if you do not specify the version of a plugin.