-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
NoSuchMethodError: old Apache library loaded in Gradle build environment #2183
Comments
I think, this is because we upgraded the http client, but your build is probably configured to pull in an earlier version. Can you include the output of Ideally you would see a dependency for |
output of
doesn't seem like an older version is being pulled in, but I might have missed something |
I cannot reproduce it. I still get the same error message with 1.8.0.
I think upgrading to 1.8.0 changed your build env to cause the new error. But it's not clear where it's coming from. Could you do |
Also, just so I'm sure: Is this a single project? No parent build.gradle, settings.gradle? |
here is the relevant portion of the stacktrace:
and, to clarify, this is a subproject, but the parent project has no relevant dependencies. I'm also not upgrading, but adding jib for the first time. Downgrading to |
^^^ Sometimes this doesn't hold true, and Does your |
@edobry have you figured out something? Did |
I ran
I ended up fixing my issue by downgrading to |
I think you can ask the parent to load in the jib plugin in the parent but not apply it (
and then use the plugin in your subproject (you can omit the version since it's specified above)
Can you see if that works? If not, there's the option of just adding the httpclient at the right version to the buildscript classpath in the root project. |
That did indeed fix the issue, thanks! May be useful to add this tip to documentation or troubleshooting. |
Yeah gradle's buildscript classpath resolution can be a little problematic :(. |
Would save me time if was present in README. |
Unsure if this will help anyone, but we encountered this when using the Gradle Artifactory plugin. The version 2.8.5 was released as a fat jar, which meant that excluding the old apache http client did not exclude the classes (the plugin's pom file still contained artifactory's compile dependencies). The shadowed dependencies/classes were being loaded regardless, causing the We were able to fix this by upgrading to 2.8.6. |
I also had this issue when combining with artifactory gradle plugin. The solution described above did the trick. |
For those hitting this issue, we've added an FAQ explaining how to properly fix this in Gradle. |
Environment:
Description of the issue:
When trying to run
gradle jibDockerBuild
with the jib gradle plugin v1.8.0, I got a very confusing error message with no results on Google:Expected behavior:
When running the same command with the jib plugin v1.7.0, I get this much more helpful error message:Steps to reproduce:
1. Kill the docker daemon2. Add the jib gradle plugin v1.8.0 to a gradle build
3. Run
gradle jibDockerBuild
jib-gradle-plugin
Configuration:The text was updated successfully, but these errors were encountered: