adoroszlai commented on code in PR #100: URL: https://github.com/apache/ozone-site/pull/100#discussion_r1882932207
########## docs/08-developer-guide/01-build/02-maven.md: ########## @@ -8,3 +8,99 @@ sidebar_label: Maven - Cover basic Maven commands to build and run tests. - Document all the Ozone specific Maven flags we use to speed up or skip parts of the build, and when they are useful. + +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 + +**TODO** : [HDDS-11625](https://issues.apache.org/jira/browse/HDDS-11625) Finalize the version numbers of prerequisite packages + +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) + +## Building Ozone + +You can build Apache Ozone either by cloning the source code from Git or by downloading the official source tarball. + +### 1. Obtain the Source Code + +Choose one of the following methods to get the source code: + +<Tabs> + <TabItem value="Git" label="Git" default> + ```bash + git clone https://github.com/apache/ozone.git + cd ozone + ``` + </TabItem> + <TabItem value="Tarball" label="Tarball"> + ```bash + curl -OL https://dlcdn.apache.org/ozone/1.4.0/ozone-1.4.0-src.tar.gz + tar xzf ozone-1.4.0-src.tar.gz + cd ozone-1.4.0-src + ``` + </TabItem> +</Tabs> + +### 2. Build the Project + +#### Basic Build + +For a basic build that skips tests: + +```bash +mvn clean package -DskipTests=true +``` + +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>` + +#### Build with Tests + +To run unit tests during the build: + +```bash +mvn clean package +``` + +#### Create Distribution Tarball + +To create a distribution tarball for deployment: + +```bash +mvn clean package -DskipTests=true -Pdist +``` + +This creates a tarball in `hadoop-ozone/dist/target` that contains all necessary files for deployment. + +### Maven Build Options + +Several Maven options are available to customize the build process: + +- `-DskipTests=true`: Skip all tests +- `-Pdist`: Enable the distribution profile to create deployment tarballs +- `-Pnative`: Build native libraries (requires additional system dependencies) +- `-T 4`: Use 4 threads for parallel building (adjust number based on your CPU) +- `-am -pl module-name`: Build a specific module and its dependencies Review Comment: `-am` is short for `--also-make`. It builds all modules that are required for the specified module(s). E.g. `-am -pl :hdds-server-scm` will build `hdds-common`, `hdds-server-framework`, etc. Prior `install` is required only if you omit `-am`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
