Skip to content

RATIS-2572. Empty dir annotations/ in ratis-proto.jar#1493

Open
adoroszlai wants to merge 1 commit into
apache:masterfrom
adoroszlai:RATIS-2572
Open

RATIS-2572. Empty dir annotations/ in ratis-proto.jar#1493
adoroszlai wants to merge 1 commit into
apache:masterfrom
adoroszlai:RATIS-2572

Conversation

@adoroszlai

@adoroszlai adoroszlai commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

maven-compiler-plugin creates the directory for sources generated by annotation processors (defined by <generatedSourcesDirectory>, with default value ${project.build.directory}/generated-sources/annotations) even if there are no processors to run. This will be fixed by apache/maven-compiler-plugin@d958a62 in 4.0.0.

ratis-proto also has sources generated for proto definitions. It is not clear why the empty generated-sources/annotations ends up in ratis-proto.jar in some environments, but not in others.

As a workaround, this PR sets the <generatedSourcesDirectory> to target/generated-sources, which is created anyway for ratis-proto.

Also add <proc>none</proc> to ensure annotation processors are indeed not used.

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

How was this patch tested?

Verified no annotations/ in generated-sources:

$ ./mvnw -am -pl :ratis-proto -DskipTests clean verify
...

$ ls ratis-proto/target/generated-sources
org

ratis-proto.jar does not contain annotations/ for me even without this patch. I hope @OneSizeFitsQuorum, the release manager of 3.2.2, can verify it locally.

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

@adoroszlai adoroszlai self-assigned this Jun 25, 2026

@szetszwo szetszwo left a comment

Copy link
Copy Markdown
Contributor

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants