Skip to content

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Create new submodule ratis-bom (Bill of Materials) for easier dependency management in projects using Ratis.

Before:

<dependency>
  <groupId>org.apache.ratis</groupId>
  <artifactId>ratis-client</artifactId>
  <version>${ratis.version}</version>
</dependency>
<dependency>
  <groupId>org.apache.ratis</groupId>
  <artifactId>ratis-common</artifactId>
  <version>${ratis.version}</version>
</dependency>
...
<dependency>
  <groupId>org.apache.ratis</groupId>
  <artifactId>ratis-server</artifactId>
  <version>${ratis.version}</version>
</dependency>

After:

<dependency>
  <groupId>org.apache.ratis</groupId>
  <artifactId>ratis-bom</artifactId>
  <version>${ratis.version}</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>

https://issues.apache.org/jira/browse/RATIS-2384

How was this patch tested?

CI:
https://github.com/adoroszlai/ratis/actions/runs/21143136602

Also tried it locally by adding ratis-bom to Ozone after mvn -DskipTests install.

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adoroszlai , thanks for working on this! Just have a minor comment inlined.

<packaging>pom</packaging>

<properties>
<ratis.thirdparty.version>1.0.10</ratis.thirdparty.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed since the child pom can use the properties in the parent pom.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for the review, patch is updated. However, I've checked some other project BOMs and found that inheriting the main module may not be a good idea. Let me double-check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right netty bom does not inherit netty main (i.e. io.netty:netty-parent)

Copy link
Contributor Author

@adoroszlai adoroszlai Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, by ratis-bom inheriting Ratis root POM (ratis), downstream project (Ozone) gets all dependency definitions (e.g. slf4j-simple) from Ratis, which is not desired.

It seems there are two solutions:

  1. Make ratis-bom independent (no parent, at least not ratis), and duplicate information like ratis.thirdparty.version. (And the list of Ratis submodules, which is already duplicated in this PR.)
  2. Make ratis-bom the parent of ratis, see pattern in Maven docs. This is an additional inheritance layer, but it reduces duplication (including list of submodules).

I think we should now go with (1), since (2) is a bigger change, maybe suitable for Ratis 4.0.

@adoroszlai adoroszlai marked this pull request as draft January 20, 2026 19:35
@adoroszlai adoroszlai marked this pull request as ready for review January 20, 2026 21:02
Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants