Skip to content
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

bootBuildImage always trys to create a native image due to bootJar always adding a META-INF/native-image/argfile to the jar #33363

Closed
wilkinsona opened this issue Nov 25, 2022 · 3 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

The file should only be added to the jar when there are args to be written to it.

@wilkinsona
Copy link
Member Author

A consequence of the empty file is that buildpacks will always try to build a native image from the app. If that's not wanted, the behaviour can be disabled by setting BP_NATIVE_IMAGE to false in the environment of the bootBuildImage task:

tasks.named("bootBuildImage") {
	environment = ["BP_NATIVE_IMAGE" : "false"]
}

@wilkinsona wilkinsona changed the title bootJar always add a META-INF/native-image/argsFile to the jar bootBuildImage always trys to create a native image due to bootJar always adding a META-INF/native-image/argsFile to the jar Nov 25, 2022
@jfiedler-jaconi
Copy link

Observing the same problem today when upgrading to Spring Boot 3. In my case even setting BP_NATIVE_IMAGE to false does not help. The build still tries to build the native image (which fails for some other incompatibility reasons).

@wilkinsona
Copy link
Member Author

Thanks, @jfiedler-jaconi. The buildpacks team will investigate why the workaround wasn't successful. In the meantime, an update has been made on the buildpacks side so the problem should no longer occur. paketobuildpacks/builder@sha256:dbc641980f88a7f1f8936302d099bbc45e50d35770b00a9379c5e66e34e7d18a is the updated builder that should be pulled the next time you run bootBuildImage.

@mhalbritter mhalbritter changed the title bootBuildImage always trys to create a native image due to bootJar always adding a META-INF/native-image/argsFile to the jar bootBuildImage always trys to create a native image due to bootJar always adding a META-INF/native-image/argfile to the jar Nov 29, 2022
@mhalbritter mhalbritter self-assigned this Nov 29, 2022
mhalbritter added a commit to mhalbritter/spring-boot that referenced this issue Nov 29, 2022
@mhalbritter mhalbritter modified the milestones: 3.0.x, 3.0.1 Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants