Skip to content

Conversation

@harti2006
Copy link
Contributor

Description

The Authzed API uses a couple of third-party proto definitions. After change #141 all of those third-party proto files were copied into the source folder and compiled as Java classes into the final JAR. This led to duplicated classes being on the classpath, e.g. com.google.rpc.Status which was now packed inside com.authzed.api:authzed and com.google.api.grpc:proto-google-common-protos. This makes dependency management very hard. Fortunately, most of the third-party protos come pre-compiled and pre-packaged with their own JAR files, available on Maven Central. They can simply be pulled in as compile-time dependency. The only exception is the grpc-gateway, where we have to copy the protos similar to the original approach.

Testing

After the build we can inspect the contents of the JAR file and verify they don't contain google or protovalidate classes.

References

This fixes #145

This fixes authzed#145.

The Authzed API uses a couple of third-party proto definitions. After change authzed#141 all of those third-party proto files were copied into the source folder and compiled as Java classes into the final JAR. This led to duplicated classes being on the classpath, e.g. com.google.rpc.Status which was now packed inside `com.authzed.api:authzed` and `com.google.api.grpc:proto-google-common-protos`. This makes dependency management very hard.
Fortunately, most of the third-party protos come pre-compiled and pre-packaged with their own JAR files, available on Maven Central. They can simply be pulled in as compile-time dependency.
The only exception is the grpc-gateway, where we have to copy the protos similar to the original approach.

Signed-off-by: André Menneken <[email protected]>
@harti2006 harti2006 requested a review from a team as a code owner October 9, 2025 07:28
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@harti2006
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@tstirrat15
Copy link
Contributor

Nice! Thank you for putting this up - I'm less-than-expert on Java dependency management and I think it would have taken me a while to arrive at this solution.

Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

LGTM

@tstirrat15 tstirrat15 added this pull request to the merge queue Oct 9, 2025
Merged via the queue into authzed:main with commit 8dcae52 Oct 9, 2025
8 of 9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2025
@harti2006 harti2006 deleted the fix/build branch October 10, 2025 08:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated com.google classes

2 participants