Exclude pre-packaged proto files from the build #151
Merged
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