Skip to content

BP_NATIVE_IMAGE=false does not work #374

@dmikusa

Description

@dmikusa

Expected Behavior

I should be able to set BP_NATIVE_IMAGE=false and it should disable native image builds. This should override any automatic detection that happens in the buildpack.

Current Behavior

If you set BP_NATIVE_IMAGE=false, it is ignored. The buildpack only looks to see if this env variable is set, it does not look at the contents.

Possible Solution

I think fixing this is just a matter of looking at the value and evaluating it as a boolean. Double check the detection process though, and make sure that's sufficient.

Steps to Reproduce

Take a Spring Boot 3.4 application from start.spring.io with Native Image support. Build it with Spring Boot build tools. The build will automatically be a native image build. Now set BP_NATIVE_IMAGE=false. It will be ignored & you'll still get a native image build.

Motivations

In the cases where the buildpack detects that native image builds should occur, a user may want to be able to override this and not have a native image build. User should be able to opt-out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions