Plugin Documentation

Goals available for this plugin:

Goal Description
build-helper:add-resource Add more resource directories to the POM.
build-helper:add-source Add more source directories to the POM.
build-helper:add-test-resource Add more test resource directories to the POM.
build-helper:add-test-source Add test source directories to the POM.
build-helper:attach-artifact Attach additional artifacts to be installed and deployed.
build-helper:bsh-property Define one or many properties as a result of a Beanshell script invocation. Like gmaven-plugin, some variables are defined:
  • project: the actual Maven project,
  • session: the executing MavenSession,
  • settings: the executing Settings.
build-helper:cpu-count Retrieve number of CPUs with project factor, and place it under a configurable project property
build-helper:help Display help information on build-helper-maven-plugin.
Call mvn build-helper:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
build-helper:local-ip Retrieve current host IP address and place it under a configurable project property
build-helper:maven-version Store the maven core version in a property maven.version.
build-helper:parse-version Parse a version string and set properties containing the component parts of the version. This mojo sets the following properties:
  [propertyPrefix].majorVersion
  [propertyPrefix].minorVersion
  [propertyPrefix].incrementalVersion
  [propertyPrefix].qualifier
  [propertyPrefix].buildNumber
Where the propertyPrefix is the string set in the mojo parameter. Note that the behaviour of the parsing is determined by org.apache.maven.artifact.versioning.DefaultArtifactVersion An osgi compatible version will also be created and made available through the property:
  [propertyPrefix].osgiVersion
This version is simply the original version string with the first instance of '-' replaced by '.' For example, 1.0.2-beta-1 will be converted to 1.0.2.beta-1
build-helper:regex-properties Sets a property by applying a regex replacement rule to a supplied value. This is similar to regex-property goal with support for multiple regex settings using RegexPropertyConfig
build-helper:regex-property Sets a property by applying a regex replacement rule to a supplied value.
build-helper:released-version Resolve the latest released version of this project. This mojo sets the following properties:
  [propertyPrefix].version
  [propertyPrefix].majorVersion
  [propertyPrefix].minorVersion
  [propertyPrefix].incrementalVersion
Where the propertyPrefix is the string set in the mojo parameter.
build-helper:remove-project-artifact Remove project's artifacts from local repository. Useful to keep only one copy of large local snapshot, for example: installer, for disk space optimization purpose.
build-helper:reserve-network-port Reserve a list of random and not in use network ports and place them in a configurable project properties.
build-helper:timestamp-property Sets a property based on the current date and time.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 2.2.1
JDK 1.5
Memory No minimum requirement.
Disk Space No minimum requirement.

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.9.1</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.9.1</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"