-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide shaded jar with dgraph4j's dependencies #239
Conversation
@ryanfoxtyler Is this something Dgraph can provide? |
tasks.named('shadowJar', ShadowJar) { | ||
enableRelocation true | ||
relocationPrefix "io.dgraph.dgraph4j.shaded" | ||
relocate 'google', 'io.dgraph.dgraph4j.shaded.google' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mangalaman93 looks like only those classes that're in the google
package are being relocated to a new namespace. So by shading only specific dependencies and not the classes in the main dgraph4j package, we should be able to maintain compatibility with existing projects as well as have a smaller jar file-size, as already noted on Discuss.
Also, should we finalize dgrap4j-shaded
as the official name for the shaded version for release ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ShadowJar
relocates all dependencies, but for some reason it does not automatically relocate the google
package. Only with this line it also includes that package.
Classes in the io.dgraph.dgraph4j
are not relocated, only dependencies.
I'd recommend to use the classifier (e.g. shaded
):
implementation "io.dgraph:dgraph4j-all:24.0.0:shaded"
rather than giving it a new archive name / artifact name:
implementation "io.dgraph:dgraph4j-shaded:24.0.0"
as this better describes of what jar this is the shaded variant.
Thank you for the PR @EnricoMi |
Using the Dgraph4j client in an application that is bound to its own Netty dependency version like Apache Spark creates conflicts that can only be resolved by shading Dgraph4j's dependencies.
Please release the shaded jar together with your other artifacts.