-
Notifications
You must be signed in to change notification settings - Fork 541
Shading: Relocate com.github.jnr artifacts to avoid classpath issues #1096
base: master
Are you sure you want to change the base?
Conversation
|
Hmm, I thought that creating this PR would trigger a build running tests using Travis but that doesn't seem to happen? |
|
I actually ended up using the non-shaded version of I get that it's probably a larger effort to fix the shading stuff so that won't just happen. Anyway, you are very welcome to use the change in this PR if it makes sense to you or decline it otherwise. |
|
Travis should run - let me take a look at that. Do you have more info on what the dependency conflict/problems were? Could they have been resolved by making sure your Maven project used the highest jnr version that both dependencies (cassandra-driver-core, docker-client) need? Or do they depend on different major versions that are API-incompatible with each other? the reason why I ask is that it feels to me like relocating dependencies in docker-client should be a last resort when there is no other simple way to resolve conflicts - otherwise I could see the list of things we relocate continue to grow until it we relocate every dependency used in docker-client. |
|
for some reason Travis thought this repo was "inactive", but that seems to be fixed now. |
I got different results with missinglink depending on whether You are right that I could depend on the highest JNR versions for both dependencies (which means that Maybe the solution is not to relocate JNR but to stop shading it? I guess shading without relocation is the real problem here? |
|
One way that you can avoid needing to care about which order you list the dependencies in your pom.xml is to add jnr to the section with the version you wish to be pulled in. That will override whatever version Maven would otherwise pull in for a transitive dependency. |
Hmm, yeah, with the non-shaded version. I got that working. So I guess we could just leave it at that and close this PR. That is fine with me :) Just a note on the shaded artifact (and please do correct me if I got this wrong): When Hmm, this shading stuff can become a little confusing. It still seems to me like shading without relocation is problematic so you should either not shade at all or shade with relocation? And then you probably need a new artifact (e.g. |
|
Hello! |
Trying to fix a conflict with cassandra-driver-core (which has a couple of dependencies to
com.github.jnrartifacts) by relocating packagejnrtocom.spotify.docker.client.shaded.jnr.As discussed at #272 (comment).
I did try to run tests locally but I had failures even before my changes, probably because my Docker setup is a bit complicated with some custom network details. I'm guessing that by creating this PR the tests will be run automatically.