You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When buildpacks are building a project from source, it is possible for the project to include the Maven or Gradle Native Build Tools plugin and configure the command line for the Maven (mvn -Pnative package) or Gradle (gradle nativeCompile) build to generate a native executable instead of a jar or war archive. The native-image buildpack currently fails in this scenario, as it expects its input to be a jar or war archive. It would be nice if the native-image buildpack would detect this scenario and skip the invocation of the native-image tool.
Motivation
Building a native executable directly from the build system might not be as common as building an archive for input to buildpacks, but advances in the NBT build plugins as well as build plugins from frameworks like Spring Boot are making this easier to do. When customization of the native-image command is required, it might be easier for users to configure this customization in a Maven pom.xml or Gradle build.gradle file than by providing BP_NATIVE_IMAGE_BUILD_ARGUMENTS or BP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE environment variables to the buildpack platform.
The text was updated successfully, but these errors were encountered:
Sounds totally reasonable. There might be some issues to work out around SBOM. The native-image buildpack generates the SBOM entry for the runtime image, so we'd have to figure out how to make that happen still. You'd also still need something to set process types.
I think the spring-boot buildpack might also need to adjust itself. It does have some logic specific to fetching the classpath for a Boot app that is compiled to native-image. That might break, depending on what changes.
Describe the Enhancement
When buildpacks are building a project from source, it is possible for the project to include the Maven or Gradle Native Build Tools plugin and configure the command line for the Maven (
mvn -Pnative package
) or Gradle (gradle nativeCompile
) build to generate a native executable instead of a jar or war archive. Thenative-image
buildpack currently fails in this scenario, as it expects its input to be a jar or war archive. It would be nice if thenative-image
buildpack would detect this scenario and skip the invocation of thenative-image
tool.Motivation
Building a native executable directly from the build system might not be as common as building an archive for input to buildpacks, but advances in the NBT build plugins as well as build plugins from frameworks like Spring Boot are making this easier to do. When customization of the
native-image
command is required, it might be easier for users to configure this customization in a Mavenpom.xml
or Gradlebuild.gradle
file than by providingBP_NATIVE_IMAGE_BUILD_ARGUMENTS
orBP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE
environment variables to the buildpack platform.The text was updated successfully, but these errors were encountered: