Build with Maven

You are viewing an old version (v. 3) of this page.
The latest version is v. 8, last edited on Oct 02, 2009 (view differences | )
<< View previous version | view page history | view next version >>

QuickBuild is able to integrate with the popular build tool - Maven. A Maven build step can be added by selecting menu item Build -> Maven from the step menu.

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, ant command location can be specified on a per-node basis by following below steps:

  1. Open Maven plugin setting page and set the property Maven Executable Path as:
    ${node.getAttribute("mvnPath")}
    
  2. For each node that does not have command mvn on system path, [define the user attribute] mvnPath to point to the actual ant command path, for example:
    mvnPath=/home/robin/bin/mvn
    

    In case of user agent node, the user attribute need to be defined in this way.

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

Build version

By default, QuickBuild uses the version defined in POM file. For example, if the POM file has the project version defined as 1.0.0, the build version will be 1.0.0. For snapshot builds, the SNAPSHOT suffix will be replaced by the real snapshot timestamp after build if:

  • The maven build step includes a deployment target
  • The property Snapshot Repository Access URL is specified in Maven plugin setting page.

If you want to control the build version from QuickBuild side, please follow below steps:

  1. Change the POM file and define the project version as $
    Unknown macro: {buildVersion}
    . Do not forget to commit the file into your SCM after change.
  2. Define a build property like below when define the Maven build step:
    buildVersion=${build.version}
    

To setup a maven based build, please perform following steps:

  1. Make sure that the Maven plugin is configured. To configure Maven plugin, you will need to switch to the Administration tab, open the Plugin Management page, and look for the plugin with id com.pmease.quickbuild.plugin.maven. Then click the configure link to bring up the configure screen as follows:
    Unable to render embedded object: File (maven-setting.png) not found.
    In this screen:
    • Repository Access URL: this property needs to be specified if you want to access the deployed maven artifacts by using QuickBuild web interface. It should be the root url to the repository, QuickBuild will append groupId and artifactId to the url to access the deployed artifacts. For example, if the deployed POM is accessed by [_], you will need to specify this property as [_].
    • Snapshot Repository Access URL: this property serves the same purpose as repository access url, except that it is used for snapshot versions. Specify the same value as the property above if the snapshot version deploys to the same repository as the regular versions.
  2. Add the maven build step to the build process as follows:
    Unable to render embedded object: File (add-maven-build-step.png) not found.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.