Skip to content

Commit

Permalink
Update build documentation (#17444)
Browse files Browse the repository at this point in the history
Add build instructions for developers
Follow up from issue #17375, add instructions solely for distribution profile. Note that this build command is mostly used by me, everyone is welcome to add further optimizations for a faster distribution build.

Co-authored-by: Abhishek Radhakrishnan <[email protected]>

* Update docs/development/build.md

Co-authored-by: Abhishek Radhakrishnan <[email protected]>

* Update docs/development/build.md

Co-authored-by: Abhishek Radhakrishnan <[email protected]>

---------

Co-authored-by: Abhishek Radhakrishnan <[email protected]>
  • Loading branch information
GWphua and abhishekrb19 authored Nov 5, 2024
1 parent e4cdbca commit ba76264
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions docs/development/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ For building the latest code in master, follow the latest version of this page
[here](https://github.com/apache/druid/blob/master/docs/development/build.md):
make sure it has `/master/` in the URL.

#### Prerequisites
## Prerequisites

##### Installing Java and Maven
### Installing Java and Maven

- See our [Java documentation](../operations/java.md) for information about obtaining a supported JDK
- [Maven version 3.x](http://maven.apache.org/download.cgi)

##### Other dependencies
### Other Dependencies

- Distribution builds require Python 3.x and the `pyyaml` module.
- Integration tests require `pyyaml` version 5.1 or later.

##### Downloading the source
## Downloading the Source Code

```bash
git clone [email protected]:apache/druid.git
cd druid
```

#### Building from source
## Building from Source

The basic command to build Druid from source is:

```bash
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.
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. Note that this build may take some time to complete.

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

Expand All @@ -72,9 +72,25 @@ Putting these together, if you wish to build the source and binary distributions
mvn clean install -Papache-release,dist,rat -DskipTests
```

#### Potential issues
### Building for Development

##### Missing `pyyaml`
For development, use only the dist profile and skip the Apache release and Apache rat profiles.

```bash
mvn clean install -Pdist -DskipTests
```

If you want to speed up the build even more, you can enable parallel building with the `-T1C` option and skip some static analysis checks.

```bash
mvn clean install -Pdist -T1C -DskipTests -Dforbiddenapis.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Dmaven.javadoc.skip=true -Denforcer.skip=true
```

You will expect to find your distribution tar file under the `distribution/target` directory.

## Potential issues

### Missing `pyyaml`

You are building Druid from source following the instructions on this page but you get
```
Expand Down

0 comments on commit ba76264

Please sign in to comment.