jib: NoSuchMethodError: old Apache library loaded in Gradle build environment
Environment:
- Jib version: 1.8.0
- Build tool: Gradle 5.4.1
- OS: OSX 10.14.6
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:
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: org.apache.http.client.config.RequestConfig$Builder.setNormalizeUri(Z)Lorg/apache/http/client/config/RequestConfig$Builder;
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 daemon
2. Add the jib gradle plugin v1.8.0 to a gradle build
3. Run gradle jibDockerBuild
jib-gradle-plugin Configuration:
plugins {
id 'com.google.cloud.tools.jib' version '1.8.0'
}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (9 by maintainers)
I think you can ask the parent to load in the jib plugin in the parent but not apply it (
apply false), so the classpaths are correct?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.