Exclude pre-packaged proto files from the build#151
Merged
tstirrat15 merged 1 commit intoauthzed:mainfrom Oct 9, 2025
Merged
Conversation
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 <andre.menneken@gropyus.com>
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
authzedbot
added a commit
to authzed/cla
that referenced
this pull request
Oct 9, 2025
This was referenced Oct 9, 2025
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:authzedandcom.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