View Source

QuickBuild is able to integrate with the popular build tool - [Maven|http://maven.apache.org]. A Maven build step can be added by selecting menu item _Build -> Maven_ from the step menu.
h1. Configure Maven command location

QuickBuild calls the command _mvn_ to run Maven build. If this command is not in system path, you will need to specify its location in plugin setting of the Maven plugin through [plugin management] page.
Further more, mvn command location can be specified on a per-node basis by following below steps:
# Open Maven plugin setting page and set the property _Maven Executable Path_ as:
{code}
${node.getAttribute("mvnPath")}
{code}
# For each node that does not have command _mvn_ on system path, [define the user attribute|Working with Build Grid#define user attributes] _mvnPath_ to point to the actual _mvn_ command path, for example:
{code}
mvnPath=/home/robin/bin/mvn
{code}
In case of user agent node, the user attribute need to be defined [in this way|Manage User Agent#define user attributes].

Please note that in above example, the _mvnPath_ user attribute is just for demonstration purpose. You can use any other user attribute name.

h1. Control build version

# If you want to control the build version from QuickBuild side, please follow below steps:
## Change the POM file and define the project version as _$\{buildVersion\}_. Do not forget to commit the file into your SCM after change.
## Define a build property like below when define the Maven build step:
{code}
buildVersion=${build.version}
{code}
# You can also instruct QuickBuild to use version in POM file as build version by checking the _Sync Build Version_ option when define the maven build step (since 5.0.8).

h1. Trigger dependent projects
When a snapshot version of a library is built, QuickBuild can be configured to do verificatin build of all projects using this snapshot library. This can be done by checking the option _Trigger Dependents_ in general setting of the library configuration. Also please make sure that the option _Resolve Effective POM_ in maven plugin setting (can be found in page _Administration/Plugin Management_) has been enabled.
{note} Newly added maven configurations have to be triggered at least once (either manually or scheduled) before this works, as QuickBuild has to set up the dependency graph first at the time of running Maven build. Also the configuration has to be built once if dependency information is changed in its POM to update the dependency graph. Normally this will not be a problem if you set up the configuration to build automatically upon repository modification with a schedule.{note}