Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Maven Partitioner

Matthew McPherrin edited this page May 20, 2016 · 4 revisions

Purpose

The Maven Partitioner was built into kochiku to assist in distributed builds for repositories containing multiple maven modules. It uses knowledge of maven's pom files to determine the present modules and group them to be run on different machines. Because of the rigid dependency structure present in java projects, the partitioner can also identify subsets of modules that need to be tested based on the changes being built. This partitioner calculates a dependency graph based on the modules in the repository and enqueues builds for only the changed modules and modules dependent on them; this can significantly reduce the number of tests run for a build or pull request, without losing any ability to track errors caused by changes upstream in the dependency tree.

Repository Set Up

The partitioner assumes a multi-module setup similar to Multi-module Enterprise Project in Maven by Example. It will parse the top-level pom.xml file and build a dependency tree of all the modules specified in the top-level pom.xml by recursing through each module's pom.xml. Once the dependency map is built it will look at the source file changes and use the dependency map to determine which modules need to be built.

kochiku.yml Configurations

The Maven Partitioner is accessed using the project-level partitioner field in your kochiku.yml, and (other than ruby and targets) the other project settings behave normally. The maven_settings field contains several settings specific to maven projects:

always_build: Takes an array of modules which will be tested with every build.

expand_directories: By default, the partitioner groups modules by their top level directory when creating build parts. This setting is an array of top level directory names which should be split apart when creating builds.

ignore_directories: Takes an array of directories which will not be built if they are changed.

queue_overrides: For each additional queue, specify the name of the queue and an array of modules to be put into the queue.

Example

partitioner: maven

test_command: script/ci

log_file_globs:
  - **/surefire-report.html

maven_settings:
  always_build:
    - acceptance-tests
  expand_directories:
    - analytics
  ignore_directories:
    - config
  queue_overrides:
    - queue: extra_ram
      paths:
        - database