Skip to content

Building

Jonathan Giles edited this page Jul 25, 2019 · 25 revisions

This document currently details Maven commands for building the brand-new preview client libraries.

JDK 8 vs JDK 11

The build system is configured to support JDK, as well as the current long-term support version of the JDK (currently JDK 11). If the commands below are run on JDK 8, there is no additional configuration required. If the commands below are to be run on JDK 11, then the -Djava-lts flag must also be provided.

pom.client.xml vs pom.data.xml

This repository contains two pom files for client libraries. pom.client.xml is the pom file for the newer, more modern client libraries, whereas pom.data.xml is the pom file for the previous generation of client libraries. The commands below all use pom.client.xml, as this document focuses on these client libraries. For client libraries that are from the previous generation, please refer to the relevant documentation for them.

Installing the build tools

A lot of the commands that follow will depend on the availability of the build tooling. This can be installed by running the following:

mvn -f eng/code-quality-reports/pom.xml install

Testing for SpotBugs and CheckStyle issues

SpotBugs and CheckStyle are configured to break the build if there is any issues discovered by them. It is therefore strongly recommended to run this locally before submitting a pull request:

mvn -f pom.client.xml -DskipTests -Dgpg.skip spotbugs:spotbugs checkstyle:checkstyle

Generating HTML reports

To generate HTML reports for 'Maven Site', as well as aggregate CheckStyle, SpotBugs, Jacoco, and JavaDoc reports, you need to run the following commands:

mvn -f pom.client.xml -Dgpg.skip install site:site site:stage

Once this completes, the generated reports are available in the following locations:

Tool Output Location
SpotBugs /eng/spotbugs-aggregate-report/target/spotbugs/spotbugsXml.html
CheckStyle /target/staging/checkstyle-aggregate.html
JavaDoc /target/staging/apidocs/index.html
Maven Site /target/staging/index.html
JaCoCo /eng/jacoco-test-coverage/target/site/test-coverage/index.html
Clone this wiki locally