-
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
Jib 3.4.2 build fails #4235
Comments
Facing the same issue also! I hope that will be fixed soon |
Hey @artemptushkin, thanks for filing the issue and appreciate you sharing the workaround! As we try to learn more, would it be possible to see how your project's dependency tree looks without the explicit inclusion of |
Are there any updates? |
We have the same issue in the jib-gradle-plugin (without the workaround). A
Other transitive dependencies request 1.21 but Gradle resolves the conflict with the newer version requested by jib-gradle-plugin. But the stacktrace shows it is the jib-gradle-plugin itself which breaks on this dependency, as can be seen in the first post. |
@adenhartog thanks for the trace My
comes from
Though no "commons-codec" in the trace for |
For comparison, we also have the spring-boot-gradle plugin but in our project. It requests 1.21 but gradle resolves it to 1.26.0 in our project:
|
If your project is a multi-module one, then it's pretty common that So, if you haven't done so, I recommend first that you strictly follow these instructions for setting up your multi-module project. That is, declare all your plugins in the project root while not applying them and then selective apply plugins in sub-projects. UPDATE: another case of Gradle lying with |
Here is a non multi-module project
This is on Gradle (wrapper) 8.6, Java 21, and Linux (Fedora 38, but also failing in GitHub CI on ubuntu-latest). It seems to be the same issue as reported above:
Stacktrace:
|
Another thing, I saw the workaround is to enforce
|
@chanseokoh Aligning the versions in de root project plugins block fixes the problem in our multi-module project. Good to know about this obscure Gradle issue/bug, thanks! |
@adenhartog glad you fixed your project. @mihalyr-prospect I think it must be that for one reason or another, your project is set up to "downgrade" the Apache commons compress 1.26.0, which is the version Jib requires. You should ensure that your build environment doesn't downgrade it. If you have to force it, do so. I can take a look if you have a reproducible sample, but I don't think Jib is doing anything wrong about it. |
@chanseokoh I shared above our |
Is there a fix in the next release? or we should force the usage of commons-compress & commons-codec? |
FWIW, there is nothing to fix in Jib. Jib asks to use the latest version of the libraries, but somehow your project is pulling an old version. Basically, it is your responsibility to correctly set up your project so that it doesn't happen. If your project is a multi-module one, make sure you follow #4235 (comment). Sometimes, you will have to manually resolve this kind of diamond dependency conflicts. |
@chanseokoh no, that's not fully right, there is no "commons-codec:commons-codec" at all as you see I have to define it by myself. There are plenty of comments here, you could take a look if you can fix it, usually it's a case that we have to enforce a libraries version in the build classpath - it doesn't happen for other plugins |
If anyone can provide a reproducible sample, I can help. |
you can take any base spring boot project on 3.2.4 |
I am not the maintainer of this repo. I am contributing my own time to help the community. Please provide a reproducible sample if it is that easy to create. |
I had some free time to look into why my build fails and in my case
Revealed this:
While running And in this particular case testcontainers already tracks the update, so it's just a matter of time until the order is restored again... testcontainers/testcontainers-java#8338 The fix was also simple once I figured out what was the problem, I've added the following into my
And now both, testcontainers and jib, seem to be working for me. |
Okay, two dependencies:
|
@mihalyr-prospect there you go! As you saw, the cause is that Gradle pulls in an old version of some library in your build environment for one reason or another where |
Moving the jib plugin version definition to the root of my multi-module project with |
Environment:
When I run
It fails with
Workaround. It works when I set this in both root and gradle submodule build.gradle.kts
Please make it work w/o workarounds
The text was updated successfully, but these errors were encountered: