-
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
containerizingMode = "packaged"
fails when jar is not already present
#2732
Comments
That's strange, we already do depend on the 'jar' task. Do you have a complicated build? Can you share your build.gradle with us? |
Unfortunately I do not have a reproducer available that I can share at the moment. We do have somewhat complex setup with multiple subproject and 'centralized' config in 'allprojects' section on the top level. As far as I can see |
I cannot reproduce this locally. Jib with containerizingMode="packaged" automatically adds the jar task as a dependency in my tests. You will have to provide us with a breaking example to move forward. I only suspect that it has something to do with your build config. (perhaps jar is disabled?) Did you try |
So default java-gradle project from idea with this gradle config:
reproduces the issue. Dry-run output:
Things work fine without |
It should not be required to use the |
We use
|
I suspect using What exactly are you configuring in Jib that requires it to be evaluated later. We have some work in progress to delay evaluation of certain jib parameters: #2727 , so you can use providers to pass in parameters at a later time? |
So we have quite complicated setup, but one thing that we have is as following:
Not using I'll see if I can move |
I think you can use this while we figure out lazy evaluation.
While I don't think it is ever ideal to configure something in the afterEvaluate block, I think this is mostly safe. |
Yeah, splitting jib config into two pieces seems to work. Thanks. Still non-obvious... :) |
@loosebazooka based on your comments (#2732 (comment) and #2732 (comment)), how do you think this particular issue can be resolved best? And in general? |
I think |
I have a gradle project configured as is: Where, each subprojects build a jar and after it is copied in build/libs of the parent. The parent has jar task disabled (because there are no sources) and use jib with containerMode packaged to copy the jars inside docker image but fails because jar is disabled. There is a solution for this? thanks |
While (@faireai-fmonorchio, please consider opening a new issue with a minimum reproducible example if your question is still relevant, since this issue appears to be a bit different from your described use case. Thanks!) |
Environment:
Description of the issue:
When
containerizingMode = "packaged"
is enabled jib tasks fail withObtaining project build output files failed
.Expected behavior:
Build should work. :)
Steps to reproduce:
containerizingMode = "packaged"
Additional Information:
Jib tasks should depend on
jar
task ifcontainerizingMode = "packaged"
is used otherwise there is no jar unless some other task builds it. AddingdependsOn('jar')
works around the issue.The text was updated successfully, but these errors were encountered: