Plugin Documentation
This report describes goals, parameters details, requirements and sample usage of this plugin.
Goals
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:
|
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:hostname | Retrieve current hostname and place it under a configurable project property |
build-helper:local-ip | Retrieve current host IP address and place it under a configurable project property |
build-helper:maven-version |
Deprecated. Maven since version 3.0.4 has such property build in: MNG-4112. So goal can be removed.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].buildNumberWhere the propertyPrefix is the string set in the mojo parameter. The parsing of the above is based on the following format of the version: <majorversion [> . <minorversion [> . <incrementalversion ] ] [> - <buildnumber | qualifier ]>It will be tried to parse the version as an OSGi version. It this is successful the following property will be set accordingly. If this is not possible a warning will be emitted. [propertyPrefix].osgiVersionThis goal also sets the following properties: [propertyPrefix].nextMajorVersion [propertyPrefix].nextMinorVersion [propertyPrefix].nextIncrementalVersion [propertyPrefix].nextBuildNumberThis goal also sets the following properties: [formattedPropertyPrefix].majorVersion [formattedPropertyPrefix].minorVersion [formattedPropertyPrefix].incrementalVersion [formattedPropertyPrefix].buildNumberThis goal also sets the following properties: [formattedPropertyPrefix].nextMajorVersion [formattedPropertyPrefix].nextMinorVersion [formattedPropertyPrefix].nextIncrementalVersion [formattedPropertyPrefix].nextBuildNumberThere is another property set which is named [propertyPrefix].qualifier and furthermore another property which is named [propertyPrefix].qualifier? which contains a prefix - if the qualifier contains anything otherwise the whole property is simply empty.
mvn build-helper:parse-version versions:set \ -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.incrementalVersion}\${parsedVersion.qualifier?}The above properties contain simply incremented versions of the parsed version informations. Those can now be used to update the version of your project via the following to the next Major version: mvn build-helper:parse-version versions:set \ -DnewVersion=\${parsedVersion.nextMajorVersion}.0.0 \ versions:commitIt can of course being used to increment the minor version: mvn build-helper:parse-version versions:set \ -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0 \ versions:commitThis can make an upgrade of the versions of your project very convenient. |
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 [propertyPrefix].buildNumber [propertyPrefix].qualifierWhere the propertyPrefix is the string set in the mojo parameter. |
build-helper:remove-project-artifact |
Deprecated. There is a similar goal: dependency:purge-local-repository By the way such goal should by not used with Maven 3/4 anymore. 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:rootlocation | This goal will get the location of the root folder within a multi module build as a property rootlocation . |
build-helper:timestamp-property | Sets a property based on the current date and time. |
build-helper:uptodate-properties | Sets multiple properties according to whether multiple sets of source and target resources are respectively up to date. |
build-helper:uptodate-property | Sets a property according to whether one set of resources is up to date with respect to another. |
System Requirements
The following specifies the minimum requirements to run this Maven plugin:
Maven | 3.6.3 |
JDK | 1.8 |
System Requirements History
The following specifies the minimum requirements to run this Maven plugin for historical versions:
Plugin Version | Maven | JDK |
---|---|---|
from 3.5.0 to 3.6.0 | 3.6.3 | 8 |
3.4.0 | 3.2.5 | 8 |
3.3.0 | 3.0 | 8 |
from 3.0.0 to 3.2.0 | 3.0 | 7 |
1.12 | 2.2.1 | 6 |
from 1.10 to 1.11 | 2.2.1 | 7 |
1.9.1 | 2.2.1 | 5 |
from 1.6 to 1.9 | 2.0.6 | 5 |
from 1.2 to 1.5 | 2.0.2 | 1.4 |
1.1 | 2.0.2 | - |
1.0 | - | - |
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>3.6.0</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> </plugin> ... </plugins> </build> ... </project>
For more information, see "Guide to Configuring Plug-ins"