Ensure only one JDK layer is ever added #79
Merged
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.
This resolves #75, which is an edge case hit when a JVM provider does not have a JRE. In that case, the buildpack would have installed the JDK, then installed a JRE, which would have been the fallback JDK. The net result is two layers that are the same, both with a JDK. However, if you try to use that with Maven to build from source, you'd get a failure because the second JDK layer overwrites the layer metadata causing the JDK to not be available at build time.
This PR resolves the issue by ensuring that the JDK layer is not installed if a JDK is going to be used as a fallback JRE. In that case, it'll skip the JDK layer and add the JRE layer with the JDK as the JRE. It then ensures that metadata flags are set to
launch=true
,build=true
, andcache=true
so this single layer works for both building and running the application.Summary
Resolves #75
Use Cases
Checklist