-
Notifications
You must be signed in to change notification settings - Fork 50
HDDS-11630. Add Build from Maven guide #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adoroszlai
merged 29 commits into
apache:HDDS-9225-website-v2
from
ptlrs:HDDS-11630-build-from-maven-guide
Jan 21, 2025
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
abbaa24
HDDS-11630. Added Building Ozone With Maven guide
ptlrs 8423cf1
HDDS-11630. Updated spelling list
ptlrs 9d4d3f8
HDDS-11630. Fix markdown linter errors
ptlrs 2145ef7
HDDS-11630. Fix review comments
ptlrs f8459bc
HDDS-11630. Fix review comments
ptlrs a5d0551
HDDS-11630. Update maven options
ptlrs ca27d88
HDDS-11630. Fix review comments
ptlrs 7591004
HDDS-11630. Fix review comments
ptlrs a3499f8
Update docs/08-developer-guide/01-build/01-maven.md
jojochuang abec6df
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs 956f1f3
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs dbb9d0b
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs 69cd6be
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs 4167650
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs ec98f47
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs a863aa3
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs fb636d0
Merge remote-tracking branch 'upstream/HDDS-9225-website-v2' into HDD…
ptlrs 6ec8baa
HDDS-11630. Fix review comments
ptlrs 38ce41e
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs 5de3cf2
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs 1eb64c4
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs 8face23
HDDS-11630. Fix review comments
ptlrs 30fd649
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs 5bfcf48
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs 77cfc83
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs ad9fa21
Remove TODO
ptlrs cef3440
Remove extra lines
ptlrs e028b18
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs a009dca
Update docs/08-developer-guide/01-build/01-maven.md
ptlrs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| --- | ||
| sidebar_label: Maven | ||
| --- | ||
|
|
||
|
|
||
| # Building Ozone With Maven | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; | ||
|
|
||
| This guide explains how to build Apache Ozone from source using Maven and prepare it for deployment. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before you begin, ensure you have the following installed on your build machine: | ||
|
|
||
| - Java 1.8 or higher | ||
| - Apache Maven 3.6.3 or higher | ||
| - Git (if building from source repository) | ||
|
|
||
| ## Obtain the Source Code | ||
|
|
||
| You can build Apache Ozone either by cloning the source code from Git or by downloading the official source tarball. | ||
|
|
||
| Choose one of the following methods to get the source code: | ||
|
|
||
| <Tabs> | ||
| <TabItem value="Git" label="Git" default> | ||
| Use this option to build any release, tag or commit of Ozone. | ||
| ```bash | ||
| git clone https://github.com/apache/ozone.git | ||
| cd ozone | ||
| ``` | ||
| </TabItem> | ||
| <TabItem value="Tarball" label="Tarball"> | ||
| Use this option if you only want a released version of Ozone. Source code for Ozone releases can be obtained from the [download page](/download). | ||
| ```bash | ||
| tar xzf ozone-<version>-src.tar.gz | ||
| cd ozone-<version>-src | ||
| ``` | ||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| ## Build the Project | ||
|
|
||
| Apache Ozone uses [Maven](https://maven.apache.org/) as its build system. The build process compiles the source code, runs tests, and creates deployable artifacts. The project supports various build configurations to accommodate different development and deployment needs. | ||
|
|
||
| ### Build Options | ||
|
|
||
| The build system offers several options to customize the build process according to your requirements | ||
|
|
||
| #### Basic Build with Tests | ||
|
|
||
| ```bash | ||
| mvn clean package | ||
| ``` | ||
|
|
||
| This command will: | ||
|
|
||
| - Clean previous build artifacts | ||
| - Compile the source code | ||
| - Package the compiled code into JAR files | ||
| - Create a distribution in `hadoop-ozone/dist/target/ozone-<version>` | ||
| - Run [unit](/docs/developer-guide/test/unit-tests) and [integration](/docs/developer-guide/test/integration-tests) tests during the build | ||
|
|
||
| :::note | ||
|
|
||
| This command does not run acceptance tests. Refer to the [acceptance tests](/docs/developer-guide/test/acceptance-tests) page for test execution instructions. | ||
|
|
||
| ::: | ||
|
|
||
| #### Common Maven Build Options | ||
|
|
||
| | Command | Description | | ||
| |-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| | `-DskipTests=true` | Skip all tests | | ||
| | `-Pdist` | This creates a tarball in `hadoop-ozone/dist/target` that contains all necessary files for deployment | | ||
| | `-DskipRecon` | Skip building the Javascript frontend for Recon | | ||
| | `-T 4` | Use 4 threads for parallel building (adjust number based on your CPU) | | ||
| | `-T 2C` | Use 2 threads per core for parallel building | | ||
| | `-am -pl :<module-name>` | Build a specific module and its dependencies when run from the root of the project | | ||
| | `-DskipShade` | Skip shading. This saves a ton of time by skipping the `ozone-filesystem-hadoop3` fat jar build used by the client | | ||
| | `-Dmaven.artifact.threads=30` | Allow Maven to download 30 artifacts at once. The default value is 5. This could speed up the build process by a lot when the Maven cache was not previously populated. | | ||
| | `-Pnative` | Build native module(s). So far it only affects `hdds-rocks-native` | | ||
|
|
||
| ### Build Output | ||
|
|
||
| The build process creates several important artifacts: | ||
|
|
||
| - **Distribution Tarball**: `hadoop-ozone/dist/target/ozone-<version>.tar.gz` (when using `-Pdist`) | ||
| - **Distribution Directory**: `hadoop-ozone/dist/target/ozone-<version>/` | ||
| - **Individual Module JARs**: `hadoop-ozone/dist/target/ozone-<version>/share/ozone/lib` | ||
|
|
||
| You can test the result of the compilation process by running a simple Ozone command which will display the Ozone version: | ||
|
|
||
| ```bash | ||
| hadoop-ozone/dist/target/ozone-<version>/bin/ozone version | ||
| ``` | ||
|
|
||
| ## Next Steps | ||
|
|
||
| Run the build by deploying the binary on either [bare metal](../../05-administrator-guide/01-installation/03-installing-binaries.md) or a [Docker cluster](../../08-developer-guide/02-run/02-docker-compose.md). | ||
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.