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 includes support to read a '.sdkmanrc' file if it's present at the root of the application.
The version order is (from lowest to highest priority): Java buildpack default (11), Maven MANIFEST.MF properties, SDKMAN RC file, and BP_JVM_VERSION. Higher priority locations override lower priority locations. Note that Maven MANIFEST.MF entries only apply to pre-compiled assets (as MANIFEST.MF won't exist in a source build) and SDKMAN RC only applies when building from source (as it won't likely exist in a pre-compiled asset).
The buildpack will read the '.sdkmanrc' file, look for the 'java' component (if multiple, it picks the first one), and takes the major Java version indicated in the entry. It ignore minor/patch versions, it also ignores the vendor (the vendor is set based on the buildpack you use). The buildpack ignores other components.
Use Cases
Developers commonly use the SDKMAN tool. It can write a
.sdkmanrc
file which can be used to indicate the Java version that's required by the application. The buildpack can read this file and use it to know which Java version to install.Checklist