-
Notifications
You must be signed in to change notification settings - Fork 173
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
Incompatibility with Spring BOM when activating jcloud's request/response logging - NoSuchMethodError: 'void ConstructorConstructor.<init>(Map)' at GsonModule.provideGson #271
Comments
Yep, the all-version is not compatible with org.apache.jclouds.driver:jclouds-slf4j because it shades com.google.inject:guice. I guess because it rewrites the client API, in this case |
Interesting ... I currently don't have the time to look into this but if someone wants to send in a fix or has an idea feel free to do so and I can merge. |
The issue is that the intersection of what is shaded and what is part of the public api of jenkins-rest is not empty. Specifically in this case, this line means that each class in the com.google package is relocated to io.github.cdancy.jenkins.rest.shaded.com.google and all imports are rewritten in the artifact with the all-classifier. And this line declares a method with a parameter of type com.google.inject.Module which means that this method has different signatures in the different artifacts. Fixes:
I'm guessing 3 is the most practical but maybe not trivial in case there are interdependencies. The gradle library plugin supports separation of api and implementation dependencies https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_separation a suggestion would be to use this plugin in jenkins-rest, and declare com.google.inject:guice as api dependence. In the best of worlds this would be recognized by the shadow jar plugin and it would do the right thing, but I do not know if this is the case. |
@BLishman send in a PR and I'll take a look! |
That sounds like a good solution to me. This will cause guice to become a regular dependency of the shadow jar whereas it previously was shadowed, but on the other hand the api does not need to change. |
Similar to #246 (but not that much actually).
I was able to squeeze the issue in the mvn project attached: project.tgz
Run the build (
mvn clean test
) (or the one and only test from your IDE), and you get:Turn on
<classifier>all</classifier>
in the pom, and you get:Now comment out
<classifier>all</classifier>
and comment out Spring's BOM, like this:and run the build again.
The test will now pass.
The issue has to do with the setup of the request/response logging:
Your Environment
The text was updated successfully, but these errors were encountered: