Building

Apache Ratis uses Apache Maven to build the artifacts. It is required to have Maven 3.3.9 or later. Apache Ratis is written in Java 8. Therefore, it as well requires Java 8 or later.

Project could be built as a usual Maven project:

$ mvn clean package -DskipTests

Note: subsequent builds could be faster with skiping shading/protobuf compile steps. See the next section for more info.

Thirdparty

All bundled thirdparty dependencies are centralized in the ratis-thirdparty module and the ratis-thirdparty-hadoop module. These modules are located in a separated repository but not attached to the core Apache Ratis repository as they only need to change when one of these dependencies are changed. All dependencies included in ratis-thirdparty/ratis-thirdparty-hadoop must be relocated to a different package to ensure no downstream classpath pollution.

Ratis developers should rely on these relocated thirdparty classes.

As a result of this thirdparty module, there is no need for skipShade options in the build which previously existed because the shaded artifacts that are generated each build are limited only to the code in Ratis itself.

What packages are shaded?

Original packagesShaded packages
com.google.commonorg.apache.ratis.thirdparty.com.google.common
com.google.protobuforg.apache.ratis.thirdparty.com.google.protobuf
com.google.thirdparty.publicsuffixorg.apache.ratis.thirdparty.com.google.thirdparty.publicsuffix
io.grpcorg.apache.ratis.thirdparty.io.grpc
io.nettyorg.apache.ratis.thirdparty.io.netty
org.apache.hadoop.ipc.protobuforg.apache.ratis.thirdparty.org.apache.hadoop.ipc.protobuf

All compiled protocol-buffer definitions in ratis-proto are stored in the org.apache.ratis.proto Java package.