Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR has two components:
It allows you to build from a JAR file. To build from a JAR, there are two requirements. First, your build artifacts must not be an exploded JAR directory. Second, you must set
BP_NATIVE_IMAGE_BUILT_ARTIFACT
and instruct the native-image buildpack what JAR file to build. For Quarkus builds with./mvnw -Dquarkus.package.type=native-sources
, this would beBP_MAVEN_BUILT_ARTIFACT="target/native-sources"
.You can build your source code locally and build an image with the
target/native-sources
directory, or you can build using the Maven buildpack and setBP_MAVEN_BUILT_ARTIFACT="target/native-sources"
.It adds
$BP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE
which allows you to specify arguments tonative-image
from a file. This is handy with Quarkus which generatesnative-image.args
, so you can setBP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE="native-sources/native-image.args"
and the buildpack will automatically load arguments from that file. It will pass through all arguments except the-jar <file>
. The buildpack overrides-jar
because it needs to ensure that the path is correct.Use Cases
Support building from a JAR file, in particular for building Quarkus based apps.
Resolves #109
Checklist