Build from source

You can build Apache Druid directly from source. Please note that these instructions are for building the latest stable version of Druid. For building the latest code in master, follow the instructions here.

Prerequisites

Installing Java and Maven:
Other Dependencies
  • for distribution build, Python and yaml module are required
Downloading the source:
  1. git clone git@github.com:apache/druid.git
  2. cd druid

Building the source

The basic command to build Druid from source is:

  1. mvn clean install

This will run static analysis, unit tests, compile classes, and package the projects into JARs. It will not generate the source or binary distribution tarball.

In addition to the basic stages, you may also want to add the following profiles and properties:

  • -Pdist - Distribution profile: Generates the binary distribution tarball by pulling in core extensions and dependencies and packaging the files as distribution/target/apache-druid-x.x.x-bin.tar.gz
  • -Papache-release - Apache release profile: Generates GPG signature and checksums, and builds the source distribution tarball as distribution/target/apache-druid-x.x.x-src.tar.gz
  • -Prat - Apache Rat profile: Runs the Apache Rat license audit tool
  • -DskipTests - Skips unit tests (which reduces build time)
  • -Ddruid.console.skip=true - Skip front end project

Putting these together, if you wish to build the source and binary distributions with signatures and checksums, audit licenses, and skip the unit tests, you would run:

  1. mvn clean install -Papache-release,dist,rat -DskipTests