Paketo BellSoft Liberica Buildpack 9.3.0 supports Java 18. However, when I configure the Gradle task bootBuildImage as described at https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#build-image.examples.buildpacks
tasks.bootBuildImage {
environment = mapOf("BP_JVM_VERSION" to "18.0.0")
buildpacks = listOf("urn:cnb:builder:paketo-buildpacks/bellsoft-liberica@9.3.0")
}
I get this error message:
Execution failed for task ':bootBuildImage'.
> Buildpack 'urn:cnb:builder:paketo-buildpacks/bellsoft-liberica@9.3.0' not found in builder
Comment From: juergenzimmermann
Using buildpacks = listOf("urn:cnb:builder:paketo-buildpacks/java@6.16.0") I get this output:
...
> Running creator
[creator] ===> ANALYZING
[creator] Restoring data for sbom from previous image
[creator] ===> DETECTING
[creator] 6 of 23 buildpacks participating
[creator] paketo-buildpacks/ca-certificates 3.1.0
[creator] paketo-buildpacks/bellsoft-liberica 9.3.0
[creator] paketo-buildpacks/syft 1.10.0
[creator] paketo-buildpacks/executable-jar 6.2.0
[creator] paketo-buildpacks/dist-zip 5.2.1
[creator] paketo-buildpacks/spring-boot 5.8.0
[creator] ===> RESTORING
[creator] Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:helper" from app image
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:java-security-properties" from app image
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jre" from app image
[creator] Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[creator] Restoring metadata for "paketo-buildpacks/spring-boot:helper" from app image
[creator] Restoring metadata for "paketo-buildpacks/spring-boot:spring-cloud-bindings" from app image
[creator] Restoring metadata for "paketo-buildpacks/spring-boot:web-application-type" from app image
[creator] Restoring data for "paketo-buildpacks/syft:syft" from cache
[creator] Restoring data for sbom from cache
[creator] ===> BUILDING
[creator]
[creator] Paketo CA Certificates Buildpack 3.1.0
[creator] https://github.com/paketo-buildpacks/ca-certificates
[creator] Launch Helper: Reusing cached layer
[creator]
[creator] Paketo BellSoft Liberica Buildpack 9.3.0
[creator] https://github.com/paketo-buildpacks/bellsoft-liberica
[creator] Build Configuration:
[creator] $BP_JVM_TYPE JRE the JVM type - JDK or JRE
[creator] $BP_JVM_VERSION 18.0.0 the Java version
[creator] Launch Configuration:
[creator] $BPL_DEBUG_ENABLED false enables Java remote debugging support
[creator] $BPL_DEBUG_PORT 8000 configure the remote debugging port
[creator] $BPL_DEBUG_SUSPEND false configure whether to suspend execution until a debugger has attached
[creator] $BPL_HEAP_DUMP_PATH write heap dumps on error to this path
[creator] $BPL_JAVA_NMT_ENABLED true enables Java Native Memory Tracking (NMT)
[creator] $BPL_JAVA_NMT_LEVEL summary configure level of NMT, summary or detail
[creator] $BPL_JFR_ARGS configure custom Java Flight Recording (JFR) arguments
[creator] $BPL_JFR_ENABLED false enables Java Flight Recording (JFR)
[creator] $BPL_JMX_ENABLED false enables Java Management Extensions (JMX)
[creator] $BPL_JMX_PORT 5000 configure the JMX port
[creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[creator] BellSoft Liberica JRE 18.0.0: Contributing to layer
[creator] Downloading from https://github.com/bell-sw/Liberica/releases/download/18+37/bellsoft-jre18+37-linux-amd64.tar.gz
[creator] Verifying checksum
[creator] Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
[creator] unable to invoke layer creator
[creator] unable to load certificates
[creator] unable to read keystore
[creator] unable to decode keystore
[creator] got invalid magic
[creator] ERROR: failed to build: exit status 1
Comment From: scottfrederick
Buildpack 'urn:cnb:builder:paketo-buildpacks/bellsoft-liberica@9.3.0' not found in builder
The urn:cnb:builder: syntax in a builder reference means that the named buildpack is bundled in the CNB builder image that is being used (by default paketobuildpacks/builder:base). Although paketo-buildpacks/bellsoft-liberica@9.3.0 and paketo-buildpacks/java@6.16.0 were recently released, it appears that the Paketo builder image you are using does not include these buildpacks.
If you want to use buildpacks before they have been released in a builder image, you should reference the buildpack image in a repository, such as:
buildpacks = listOf("docker://gcr.io/paketo-buildpacks/java:9.3.0")
[creator] unable to invoke layer creator [creator] unable to load certificates [creator] unable to read keystore [creator] unable to decode keystore [creator] got invalid magic
This is a known constraint with Paketo buildpacks related to the ordering of the CA Certificates and Java buildpacks. The work-around is to list the paketo-buildpacks/ca-certificates buildpack before any Java buildpacks when alternate Java buildpacks are specified.
As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. This feels like a question that would be better suited to Stack Overflow. Please follow up there if you have additional questions.
Comment From: scottfrederick
There is an issue with the Paketo ca-certificates buildpack and Java 18. See https://github.com/paketo-buildpacks/libjvm/issues/158 for details.
Comment From: juergenzimmermann
@scottfrederick David O'Sullivan created the issue after my message at https://paketobuildpacks.slack.com, see https://app.slack.com/client/TUKS9UTJQ/CULAS8ACD/thread/CULAS8ACD-1648878910.298049
Comment From: scottfrederick
@juergenzimmermann I saw the Slack thread, thanks for starting the discussion there. I added the link in the comment above in case others come across this issue in a search.