-
Notifications
You must be signed in to change notification settings - Fork 17
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
workspace.jar in gradle build output break the build #54
Comments
Sorry, I can't reproduce this with your test app. I'm running: I don't know where the Are you still seeing this issue? Does running a clean locally help? Any ideas where |
The app has changed a little since then (Gradle 7.0 migration) but I can still repro the issue. If I build the artifacts: But if I just clean the artifacts: I have no idea where the If I fake the jar:
so the buildpack definitely cares about my local jar, I don't get why. If I build the jar:
|
Adding this config to
I'm not sure what the Gradle buildpack should do about this, short of cleaning the |
Makes perfect sense, I should have seen this coming. 😄 Can I have a few questions around this behavior? copying the build folder
Why is the What do you think, should part of this issue be fixed by ignoring the Gradle build output folder during copying renaming the root project
I guess setting
|
The
I think that's the most common case. |
+1 to what @scottfrederick said here. I would also add that you can include a https://buildpacks.io/docs/app-developer-guide/using-project-descriptor/#example Ex:
I would have to look into this one more. My fear of adding
I don't believe this is possible.
I'm not sure about this. I don't know where we'd pull a name from. The outer directory where Gradle get's the name from locally never makes it into the build container. The
I'm not sure we'd have to go this far, it already fails. Plus, there can be cases where it's OK to build workspace.jar and use that. I don't think I hit this when I tried to reproduce cause I didn't build locally first. What I can certainly do though is improve the error messages. Presently you'll see:
I could change it to something like:
Does that seem like a reasonable path forward? |
@scottfrederick @dmikusa-pivotal Makes sense, thanks for the answers. |
What happened?
The base builder (
pack config default-builder paketobuildpacks/builder:base
) fails on a simple gradle project, with the following output:As you can see the Gradle build was successful, it also produced the jar in
build/libs
(see:/workspace/build/libs/app-info.jar
) but there is another jar next to it:/workspace/build/libs/workspace.jar
that was not created by Gradle. So the image build process fails because there are more artifacts.What were you attempting to do?
I have a sample project, it is just a simple Gradle project with the
application
plugin. Runningpack build app-info
fails (assuming that the default-builder ispaketobuildpacks/builder:base
).What did you expect to happen?
The expectation would be not having an extra jar in the Gradle build output.
What was the actual behavior? Please provide log output, if possible.
See the eror above.
Build Configuration
pack
,kpack
,tekton
buildpacks plugin, etc.) are youusing? Please include a version.
What buildpacks are you using? Please include versions.
The ones discovered and added by
paketobuildpacks/builder:base
on this sample projectWhat builder are you using? If custom, can you provide the output from
pack inspect-builder <builder>
?paketobuildpacks/builder:base
Can you provide a sample app or relevant configuration (
buildpack.yml
,nginx.conf
, etc.)?sample project
Checklist
Workaround
Setting the build artifact manually hides the issue and the build succeeds:
pack build app-info --env 'BP_GRADLE_BUILT_ARTIFACT=build/libs/app-info.jar'
The text was updated successfully, but these errors were encountered: