GithubHelp home page GithubHelp logo

paketo-buildpacks / bellsoft-liberica Goto Github PK

View Code? Open in Web Editor NEW
68.0 7.0 21.0 1009 KB

A Cloud Native Buildpack that provides the Bellsoft Liberica implementations of JREs and JDKs

License: Apache License 2.0

Go 56.90% Shell 43.10%
cnb bellsoft-liberica jvm jvm-applications hacktoberfest

bellsoft-liberica's Introduction

gcr.io/paketo-buildpacks/bellsoft-liberica

The Paketo Buildpack for BellSoft Liberica is a Cloud Native Buildpack that provides the BellSoft Liberica implementations of JREs and JDKs.

This buildpack is designed to work in collaboration with other buildpacks which request contributions of JREs and JDKs.

Behavior

This buildpack will participate if any of the following conditions are met

  • Another buildpack requires jdk
  • Another buildpack requires jre

The buildpack will do the following if a JDK is requested:

  • Contributes a JDK to a layer marked build and cache with all commands on $PATH
  • Contributes $JAVA_HOME configured to the build layer
  • Contributes $JDK_HOME configure to the build layer

The buildpack will do the following if a JRE is requested:

  • Contributes a JRE to a layer with all commands on $PATH
  • Contributes $JAVA_HOME configured to the layer
  • Contributes -XX:ActiveProcessorCount to the layer
  • Contributes -XX:+ExitOnOutOfMemoryError to the layer
  • Contributes -XX:+UnlockDiagnosticVMOptions,-XX:NativeMemoryTracking=summary & -XX:+PrintNMTStatistics to the layer (Java NMT)
  • If BPL_JMX_ENABLED = true
    • Contributes -Djava.rmi.server.hostname=127.0.0.1, -Dcom.sun.management.jmxremote.authenticate=false, -Dcom.sun.management.jmxremote.ssl=false & -Dcom.sun.management.jmxremote.rmi.port=5000
  • If BPL_DEBUG_ENABLED = true
    • Contributes -agentlib:jdwp=transport=dt_socket,server=y,address=*:8000,suspend=n. If Java version is 8, address parameter is address=:8000
  • If BPL_JFR_ENABLED = true
    • Contributes -XX:StartFlightRecording=dumponexit=true,filename=/tmp/recording.jfr
  • Contributes $MALLOC_ARENA_MAX to the layer
  • Disables JVM DNS caching if link-local DNS is available
  • If metadata.build = true
    • Marks layer as build and cache
  • If metadata.launch = true
    • Marks layer as launch
  • Contributes Memory Calculator to a layer marked launch
  • Contributes Heap Dump helper to a layer marked launch

Configuration

Environment Variable Description
$BP_JVM_VERSION Configure the JVM version (e.g. 8, 11, 17, 21). The buildpack will download JDK and JRE assets that are compatible with this version of the JVM specification. Since the buildpack only ships a single version of each supported line, updates to the buildpack can change the exact version of the JDK or JRE. In order to hold the JDK and JRE versions stable, the buildpack version itself must be stable.

Buildpack releases (and the dependency versions for each release) can be found here. Few users will use this buildpack directly, instead consuming a language buildpack like paketo-buildpacks/java who's releases (and the individual buildpack versions and dependency versions for each release) can be found here. Finally, some users will will consume builders like paketobuildpacks/builder:base who's releases can be found here. To determine the individual buildpack versions and dependency versions for each builder release use the pack inspect-builder <image> functionality.

$BP_JVM_TYPE Configure the JVM type that is provided at runtime, i.e. a JDK or JRE - accepts values "JDK" or "JRE" (default). If a JRE type is requested but not available, a JDK will be provided.
$BPL_JVM_HEAD_ROOM Configure the percentage of headroom the memory calculator will allocated. Defaults to 0.
$BPL_JVM_LOADED_CLASS_COUNT Configure the number of classes that will be loaded at runtime. Defaults to 35% of the number of classes.
$BPL_JVM_THREAD_COUNT Configure the number of user threads at runtime. Defaults to 250.
$BPL_JVM_CLASS_ADJUSTMENT Absolute or percentage based adjustment of the memory calculator's class count, which influences various memory settings of the JVM. This is useful when the number of classes cannot be reliably determined during build-time and workloads run into OOM situations. Defaults to 100%.
$BPL_HEAP_DUMP_PATH Configure the location for writing heap dumps in the event of an OutOfMemoryError exception. Defaults to ``, which disables writing heap dumps. The path set must be writable by the JVM process.
$BPL_JAVA_NMT_ENABLED Configure whether Java Native Memory Tracking (NMT) is enabled. Defaults to true. Set this to false to disable NMT functionality.
$BPL_JAVA_NMT_LEVEL Configure the level of detail for Java Native Memory Tracking (NMT) output. Defaults to summary. Set this to detail for detailed NMT output.
$BPL_JMX_ENABLED Configure whether Java Management Extensions (JMX) is enabled. Defaults to false. Set this to true to enable JMX functionality.
$BPL_JMX_PORT Configure the port number for JMX. Defaults to 5000. When running the container, this value should match the port published locally, i.e. for Docker: --publish 5000:5000
$BPL_DEBUG_ENABLED Configure whether remote debugging features are enabled. Defaults to false. Set this to true to enable remote debugging.
$BPL_DEBUG_PORT Configure the port number for remote debugging. Defaults to 8000.
$BPL_DEBUG_SUSPEND Configure whether to suspend execution until a debugger has attached. Defaults to false.
$BPL_JFR_ENABLED Configure whether Java Flight Recording (JFR) is enabled. If no arguments are specified via BPL_JFR_ARGS, the default config args dumponexit=true,filename=/tmp/recording.jfr are added.
$BPL_JFR_ARGS Configure custom arguments to Java Flight Recording, via a comma-separated list, e.g. duration=10s,maxage=1m. If any values are specified, no default args are supplied.
$BP_JVM_JLINK_ENABLED Configures whether to run the JDK's jlink tool at build time to generate a custom JRE. Defaults to false. If no custom args are specified, the default args are --no-man-pages --no-header-files --strip-debug --compress=1.
$BP_JVM_JLINK_ARGS Configure custom arguments to supply to the jlink tool. If any custom args are specified, no default args are supplied.
$JAVA_TOOL_OPTIONS Configure the JVM launch flags

Bindings

The buildpack optionally accepts the following bindings:

Type: dependency-mapping

Key Value Description
<dependency-digest> <uri> If needed, the buildpack will fetch the dependency with digest <dependency-digest> from <uri>

License

This buildpack is released under version 2.0 of the Apache License.

bellsoft-liberica's People

Contributors

anthonydahanne avatar c0d1ngm0nk3y avatar christopherclark avatar dashaun avatar dependabot[bot] avatar dimibe avatar dmikusa avatar eddumelendez avatar ekcasey avatar modulo11 avatar nebhale avatar paketo-bot avatar pivotal-david-osullivan avatar schnatterer avatar twoseat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bellsoft-liberica's Issues

GraalVM 22.3.0 with Java 19

Hello, I hope ur good!
I was trying to get spring boot native working with the java-native-image buildpacks.

The actual problem is that the repo is missing the native-image-svm for java 19 like java 17 has:
Java 17 native

Is the support soon planning? Thanks you!

Here some more info on the problems:
Paketo Buildpack for BellSoft Liberica 9.10.0 [creator] unable to find dependency [creator] no valid dependencies for native-image-svm, 19.0.1, and io.paketo.stacks.tiny in [(jdk, 8.0.352, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 8.0.352, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 11.0.17, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 11.0.17, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (native-image-svm, 11.0.17, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 17.0.5, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 17.0.5, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (native-image-svm, 17.0.5, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 19.0.1, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 19.0.1, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *])] [creator] ERROR: failed to build: exit status 1

github bellsoft-jre17.0.5+8-linux-amd64.tar.gz x509: certificate signed by unknown authority

i learning docker,
java 17.0.5 2022-10-18 LTS
Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing)

when i generate docker images, it send me this problem.What is problem. i try it a lot of solution at this page and anohter page. Add cert ...
Can you help me please?

Running creator
[INFO] [creator] ===> ANALYZING
[INFO] [creator] Previous image with name "docker.io/eazybytes/configserver:latest" not found
[INFO] [creator] ===> DETECTING
[INFO] [creator] 6 of 24 buildpacks participating
[INFO] [creator] paketo-buildpacks/ca-certificates 3.5.1
[INFO] [creator] paketo-buildpacks/bellsoft-liberica 9.10.1
[INFO] [creator] paketo-buildpacks/syft 1.23.0
[INFO] [creator] paketo-buildpacks/executable-jar 6.5.0
[INFO] [creator] paketo-buildpacks/dist-zip 5.4.0
[INFO] [creator] paketo-buildpacks/spring-boot 5.22.0
[INFO] [creator] ===> RESTORING
[INFO] [creator] ===> BUILDING
[INFO] [creator]
[INFO] [creator] Paketo Buildpack for CA Certificates 3.5.1
[INFO] [creator] https://github.com/paketo-buildpacks/ca-certificates
[INFO] [creator] Launch Helper: Contributing to layer
[INFO] [creator] Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[INFO] [creator]
[INFO] [creator] Paketo Buildpack for BellSoft Liberica 9.10.1
[INFO] [creator] https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO] [creator] Build Configuration:
[INFO] [creator] $BP_JVM_JLINK_ARGS --no-man-pages --no-header-files --strip-debug --compress=1 configure custom link arguments (--output must be omitted)
[INFO] [creator] $BP_JVM_JLINK_ENABLED false enables running jlink tool to generate custom JRE
[INFO] [creator] $BP_JVM_TYPE JRE the JVM type - JDK or JRE
[INFO] [creator] $BP_JVM_VERSION 17.* the Java version
[INFO] [creator] Launch Configuration:
[INFO] [creator] $BPL_DEBUG_ENABLED false enables Java remote debugging support
[INFO] [creator] $BPL_DEBUG_PORT 8000 configure the remote debugging port
[INFO] [creator] $BPL_DEBUG_SUSPEND false configure whether to suspend execution until a debugger has attached
[INFO] [creator] $BPL_HEAP_DUMP_PATH write heap dumps on error to this path
[INFO] [creator] $BPL_JAVA_NMT_ENABLED true enables Java Native Memory Tracking (NMT)
[INFO] [creator] $BPL_JAVA_NMT_LEVEL summary configure level of NMT, summary or detail
[INFO] [creator] $BPL_JFR_ARGS configure custom Java Flight Recording (JFR) arguments
[INFO] [creator] $BPL_JFR_ENABLED false enables Java Flight Recording (JFR)
[INFO] [creator] $BPL_JMX_ENABLED false enables Java Management Extensions (JMX)
[INFO] [creator] $BPL_JMX_PORT 5000 configure the JMX port
[INFO] [creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[INFO] [creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[INFO] [creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[INFO] [creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[INFO] [creator] Using Java version 17.* from BP_JVM_VERSION
[INFO] [creator] BellSoft Liberica JRE 17.0.5: Contributing to layer
[INFO] [creator] Downloading from https://github.com/bell-sw/Liberica/releases/download/17.0.5+8/bellsoft-jre17.0.5+8-linux-amd64.tar.gz
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to get dependency jre
[INFO] [creator] unable to download https://github.com/bell-sw/Liberica/releases/download/17.0.5+8/bellsoft-jre17.0.5+8-linux-amd64.tar.gz
[INFO] [creator] unable to request https://github.com/bell-sw/Liberica/releases/download/17.0.5+8/bellsoft-jre17.0.5+8-linux-amd64.tar.gz
[INFO] [creator] Get "https://objects.githubusercontent.com/github-production-release-asset-2e65be/115621629/4522d780-0a4c-40ae-a3d1-d70a38bda0b9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221222%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221222T133020Z&X-Amz-Expires=300&X-Amz-Signature=43da7e88ed229441a0bf4e8eb6dcf912aa60ca1c44bed3d8832b26382c49e091&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=115621629&response-content-disposition=attachment%3B%20filename%3Dbellsoft-jre17.0.5%2B8-linux-amd64.tar.gz&response-content-type=application%2Foctet-stream": x509: certificate signed by unknown authority
[INFO] [creator] ERROR: failed to build: exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.736 s
[INFO] Finished at: 2022-12-22T16:30:09+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.4:build-image (default-cli) on project configserver: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.7.4:build-image failed: Builder lifecycle 'creator' failed with status code 51 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

New release needed due to vulnerability in dependecy.

Expected Behavior

Vulnerability scanner shouldn't find high risk vulnerabilities in in this paketo buildpack

Current Behavior

Trivy vulnerability scanner is finding a high risk vulnerability in Paketo BellSoft Liberica Buildpack 9.6.1

golang.org/x/net │ CVE-2022-27664 │ HIGH │ v0.0.0-20220822230855-b0a4917ee28c │ 0.0.0-20220906165146-f3363e06e74c │ golang: net/http: handle server errors after sending GOAWAY https://avd.aquasec.com/nvd/cve-2022-27664

Possible Solution

Publish a new release. I can see that the newest golang libraries have been added to the repo, but no new release generated.

Steps to Reproduce

  1. Create an image of any Spring Boot project, and run a Trivy vulnerability scan against it.

Motivations

We don't allow any of our releases to go ahead if it contains high or critical vulnerabilities.

Thanks.

Mismatch between JRE/JDK version and cpes+version under metadata.dependencies in v9.8.0

I was scanning the SBOM provided for the bellsoft-liberica buildpack and was expecting to see 5 vulnerabilities reported using grype. However, zero vulnerabilities where detected because the version in the SBOM is 11.0.16 however, the version of java packaged by the buildpack in 9.8.0 I believe is version 11.0.16.1 as reported from my running container.

$ /layers/paketo-buildpacks_bellsoft-liberica/jre/bin/java -version
Picked up JAVA_TOOL_OPTIONS: -Dmanagement.endpoint.health.probes.add-additional-paths="true" -Dmanagement.endpoint.health.show-details=always -Dmanagement.endpoints.web.base-path="/actuator" -Dmanagement.endpoints.web.exposure.include=* -Dmanagement.health.probes.enabled="true" -Dmanagement.server.port="8081" -Dserver.port="8080" -Dserver.shutdown.grace-period="24s"
openjdk version "11.0.16.1" 2022-08-12 LTS
OpenJDK Runtime Environment (build 11.0.16.1+1-LTS)
OpenJDK 64-Bit Server VM (build 11.0.16.1+1-LTS, mixed mode)

Expected Behavior

I would expect the cpes section of the SBOM to be equal to 11.0.16.1 for both JDK and JRE

"cpe:2.3:a:oracle:jdk:11.0.16.1:*:*:*:*:*:*:*"
"cpe:2.3:a:oracle:jre:11.0.16.1:*:*:*:*:*:*:*"

Current Behavior

The version returned is 11.0.16

Possible Solution

My understanding is the SBOM is generated using the information in the buildpack.toml.

Steps to Reproduce

  1. Use kpack or pack to build the image using v9.8.0 of this buildpack.
  2. Use the pack cli to download the sbom pack sbom download localhost:5000/supply-chain/tanzu-java-web-app-default@sha256:333bb5b40eea3306b9425f6f167b71ee5e41c9aae1734d6fda8bcb68b90b4a95 --remote
  3. Use the grype cli to perform a scan of the SBOM to generate a vulnerability report grype layers/sbom/launch/paketo-buildpacks_bellsoft-liberica/jre/sbom.syft.json
  4. Notice the output indicates that there are no vulnerabilities found.

Motivations

Scanners such as grype, trivy, etc, have a difficult time discovering the JRE flavor and version included via buildpacks. To accomplish this outcome we need to scan the SBOM for the bellsoft layer, in addition, the performing a full image scan. Performing a full image scan will not detect the JRE installed.

Update the Detect script to fail detection if the JVM version asked for is not supported

During the planning phase, if the buildpack version doesn't provide the JVM version asked for, the detection for that particular version of bellsoft-liberica should fail/skip.

Describe the Enhancement

Currently, regardless of what version you provide as BP_JVM_VERSION, the detection phase passes for even those versions that don't provide the JVM version asked for.
As an example, if you set

BP_JVM_VERSION="8.0.333"

the detection still passes for the version 9.8.0. This results in build failure later when the error,

Paketo Buildpack for BellSoft Liberica 9.8.0
  unable to find dependency
  no valid dependencies for jdk, 8.0.333

Possible Solution

The Detect script might help here if we make sure not to pass detection unless the JVM version asked for is supported.

Motivation

We are trying to support multiple versions of the same buildpack, and select one of them depending on the value of BP_JVM_VERSION.

After BuildPack 8.7.0, JVM Launch Error in JRE 8

What happened?

  • What were you attempting to do?
    Run a docker image built by bootBuildGradle with Gradle 7.1, Java 8 and Spring Boot 2.5.4.

  • What did you expect to happen?
    Successfully run a docker image

  • What was the actual behavior? Please provide log output, if possible.
    When I run a docker image built by BuildPack, Some JVM error occurs. This error appears after 8.7.0 released.
    below is a log header and full log file hs_err_pid1.log

    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  SIGSEGV (0xb) at pc=0x00007f2fc8dc22f7, pid=1, tid=0x00007f2fc9f2a700
    #
    # JRE version:  (8.0_302-b08) (build )
    # Java VM: OpenJDK 64-Bit Server VM (25.302-b08 mixed mode linux-amd64 compressed oops)
    # Problematic frame:
    # V  [libjvm.so+0xb2a2f7]  VirtualMemoryTracker::add_reserved_region(unsigned char*, unsigned long, NativeCallStack const&, MemoryType, bool)+0x77
    #
    # Core dump written. Default location: /workspace/core or core.1
    #
    # If you would like to submit a bug report, please visit:
    #   https://bell-sw.com/support
    #
    

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.
    I have no idea. I used only pure bootBuildImage

  • What buildpacks are you using? Please include versions.
    A log of bootBuildImage with JVM errored verion,
    error_version_log.txt

    A log of bootBuildImage at yesterday that successfully launched. and it is same when force downgrade to 8.6.0
    success_version_log.txt

    I think JVM Option changes after BuildPack 8.7.0 cause error.
    I checked UnlockDiagnosticVMOptions NativeMemoryTracking PrintNMTStatistics options are added
    And I've tried set docker env or gradle build option with JAVA_TOOL_OPTIONS to disable those things. But not works.

    So, I forced downgrade builderpack version to 8.6.0 and it works.

    bootBuildImage {
      builder = "paketobuildpacks/builder@sha256:3c5f88e55da475957bd03b4d6e852e0938bb73ee1a5184ae291a7566ca83d97f"
      runImage = "paketobuildpacks/run@sha256:562ddd10160a2629168a0108894766b46dff7f4b0db263ecabe35cd56fcbe56d"
    }
    
  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?
    No Customs

  • Can you provide a sample app or relevant configuration (buildpack.yml,
    nginx.conf, etc.)?
    Simple docker image build with run ./gradlew bootBuildImage with Spring Boot project in Github Action.
    And Simple launch with Docker docker run [built-image]

    name: ci
    
    on:
      push:
        branches:
          - 'release'
    
    jobs:
      docker:
        runs-on: ubuntu-latest
        steps:
          - name: Set up Docker Buildx
            uses: docker/setup-buildx-action@v1
          - uses: actions/checkout@v2
          - name: Set up JDK 1.8
            uses: actions/setup-java@v1
            with:
              java-version: 1.8
          - name: Grant execute permission for gradlew
            run: chmod +x gradlew
          - name: Build bootBuildImage with version
            run: ./gradlew bootBuildImage

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

JVM default encoding is not set to UTF-8

What happened?

Docker image prepared by paketo-buildpacks/bellsoft-liberica using spring-boot-maven-plugin in version 2.3.12.RELEASE is not using UTF-8 as default encoding. UTF-8 encoding is most common encoding type and should be used as a default one.

  • What were you attempting to do?
    Integrate java spring-boot application with azure blob storage using com.azure.azure-storage-blob in version 12.6.0 and list blobs which under the hood query azure backend for xml response.

  • What did you expect to happen?
    Default encoding of JVM is set to UTF-8 because it's most common encoding.

  • What was the actual behavior? Please provide log output, if possible.
    Request listing blob return xml with BOM for UTF-8 <?xml version="1.0" encoding="utf-8"?> which is then incorrectly parsed.

Below log is from spring boot application at runtime (not from buildpack build process).

Caused by: com.azure.core.exception.HttpResponseException: HTTP response has a malformed body.
	at com.azure.core.implementation.serializer.HttpResponseBodyDecoder.lambda$decode$1(HttpResponseBodyDecoder.java:95)
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:118)
	at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:123)
	at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:112)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:213)
	at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:123)
	at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:178)
	at reactor.core.publisher.FluxContextStart$ContextStartSubscriber.onNext(FluxContextStart.java:96)
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1812)
	at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:121)
	at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:252)
	at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
	at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:383)
	at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:373)
	at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:429)
	at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:655)
	at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:96)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1368)
	at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1245)
	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1282)
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	... 1 more
Caused by: com.azure.core.implementation.serializer.MalformedValueException: Unexpected first character (char code 0xEF), not valid in xml document: could be mangled UTF-8 BOM marker. Make sure that the Reader uses correct encoding or pass an InputStream instead
	at com.azure.core.util.serializer.JacksonAdapter.deserialize(JacksonAdapter.java:184)
	at com.azure.core.implementation.serializer.HttpResponseBodyDecoder.deserializeBody(HttpResponseBodyDecoder.java:176)
	at com.azure.core.implementation.serializer.HttpResponseBodyDecoder.lambda$decode$1(HttpResponseBodyDecoder.java:88)
	... 46 more
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected first character (char code 0xEF), not valid in xml document: could be mangled UTF-8 BOM marker. Make sure that the Reader uses correct encoding or pass an InputStream instead
	at com.fasterxml.jackson.dataformat.xml.util.StaxUtil.throwAsParseException(StaxUtil.java:37)
	at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:584)
	at com.fasterxml.jackson.dataformat.xml.XmlFactory.createParser(XmlFactory.java:464)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3468)
	at com.azure.core.util.serializer.JacksonAdapter.deserialize(JacksonAdapter.java:179)
	... 48 more
Caused by: com.ctc.wstx.exc.WstxIOException: Unexpected first character (char code 0xEF), not valid in xml document: could be mangled UTF-8 BOM marker. Make sure that the Reader uses correct encoding or pass an InputStream instead
	at com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:175)
	at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:573)
	at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:633)
	at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:687)
	at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:350)
	at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:582)
	... 51 more

Build Configuration

default spring boot configuration in version boot 2.3.12.RELEASE

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <layers>
            <enabled>true</enabled>
        </layers>
        <image>
            <name>${docker-image-name}</name>
            <env>
                <BP_JVM_VERSION>${project.java.source}</BP_JVM_VERSION>
            </env>
        </image>
    </configuration>
</plugin>

Problem can be solved by passing JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 but it's not obvious at the beginning

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

Add support for `JDK_JAVA_OPTIONS`

Describe the Enhancement

I'm not sure if it's bug or feature. But we need to support JDK_JAVA_OPTIONS environment variable. One specific use case is to add --add-opens flag which doesn't seem to be possible to do via JAVA_TOOL_OPTIONS anymore (tested on Java 17).

The full story is here. Thanks.

How to replace the JRE download address or put bellsoft-jre15.0.1+9-linux-amd64.tar.gz into the image that I have downloaded.

What happened?

`
[INFO] [creator] BellSoft Liberica JRE 15.0.1: Contributing to layer

[INFO] [creator] Downloading from https://github.com/bell-sw/Liberica/releases/download/15.0.1+9/bellsoft-jre15.0.1+9-linux-amd64.tar.gz

[INFO] [creator] unable to invoke layer creator

[INFO] [creator] unable to get dependency jre

[INFO] [creator] unable to download https://github.com/bell-sw/Liberica/releases/download/15.0.1+9/bellsoft-jre15.0.1+9-linux-amd64.tar.gz
`
Please provide some details about the task you are trying to accomplish and
what went wrong.

  • What were you attempting to do?

I want to build springboot application as image with the following command:
mvn spring-boot:build-image

  • What did you expect to happen?
    Downloading bellsoft-jre15.0.1+9-linux-amd64.tar.gz is slow and often time out in my country.
    How to replace the JRE download address or put bellsoft-jre15.0.1+9-linux-amd64.tar.gz into the image that I have downloaded.
    Thanks.

Override paketo-buildpacks download URIs

When executing the Gradle 'bootBuildImage' task, paketo-buildpacks downloads artifacts (e.g., the BellSoft Liberica JRE) from a seemingly hardcoded github URL:

Paketo BellSoft Liberica Buildpack 2.7.1
    [creator]         Set $BPL_JVM_HEAD_ROOM to configure the headroom in memory calculation. Default 0.
    [creator]         Set $BPL_JVM_LOADED_CLASS_COUNT to configure the number of loaded classes in memory calculation. Default 35% of classes.
    [creator]         Set $BPL_JVM_THREAD_COUNT to configure the number of threads in memory calculation. Default 250.
    [creator]         Set $BP_JVM_VERSION to configure the Java version. Default 11.*.
    [creator]       BellSoft Liberica JRE 14.0.1: Contributing to layer
    [creator]         Downloading from https://github.com/bell-sw/Liberica/releases/download/14.0.1+8/bellsoft-jre14.0.1+8-linux-amd64.tar.gz

Inside a corporate environment, there may not be direct access to github.com. Is it possible to somehow replace github.com with my-company.com, so that the same artifacts can be downloaded from a proxy repository (e.g., company-internal Nexus, Artifactory, etc)?

sha256 for bellsoft-liberica-vm-core-openjdk11-22.0.0.2-linux-amd64.tar.gz does not match expected

Getting this currently with 9.0.4 and JDK 11:

    [creator]     Paketo BellSoft Liberica Buildpack 9.0.4
    [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              11.*            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 NIK 11.0.14: Contributing to layer
    [creator]         Downloading from https://download.bell-sw.com/vm/22.0.0.2/bellsoft-liberica-vm-core-openjdk11-22.0.0.2-linux-amd64.tar.gz
    [creator]         Verifying checksum
    [creator]     unable to invoke layer creator
    [creator]     unable to get dependency native-image-svm
    [creator]     sha256 for /tmp/d294c2b8a854158c09d3d9742d299d8b544bb6943c6c488e71be05f1e555a49a/bellsoft-liberica-vm-core-openjdk11-22.0.0.2-linux-amd64.tar.gz 70622a8340e9870fb454515a936f138fc33a1406c7cdc486afcd4d32c1bf4cc9 does not match expected d294c2b8a854158c09d3d9742d299d8b544bb6943c6c488e71be05f1e555a49a
    [creator]     ERROR: failed to build: exit status 1

Setting BP_JVM_VERSION to 17 works around it.

BPL_JVM_THREAD_COUNT not works

What happened?

When building a spring boot app, BPL_JVM_THREAD_COUNT and JAVA_TOOL_OPTIONS are specified for pack, but running on k8s results in error:

Setting Active Processor Count to 2
unable to calculate memory configuration
fixed memory regions require 625098K which is greater than 600M available for allocation: -XX:MaxDirectMemorySize=10M, -XX:MaxMetaspaceSize=113098K, -XX:ReservedCodeCacheSize=240M, -Xss1M * 250 threads

It seems that the memory calculator(uses -Xss1M * 250 threads) does not know the options I passed to pack(100 * 256k).

Build Configuration

         pack build $image_name \
           --builder $pack_builder \
           --volume `dirname $0`/paketo/dependency-mapping:/platform/bindings/dependency-mapping \
           --pull-policy if-not-present \
           --env BP_JVM_VERSION=$bp_jvm_version \
           --env BPL_JVM_THREAD_COUNT=100 \
           --env JAVA_TOOL_OPTIONS="-Xss256k" \
           --path target/*.jar

Go should be upgraded; currently using 1.20 which is EOL and has security issues

Expected Behavior

This project currently uses go 1.20 which is EOL and unsupported, see https://go.dev/doc/devel/release It also has security vulnerabilities which scanners such as Trivy report.

Therefore, I believe that this project should upgrade go to 1.21 or better yet 1.22.

Current Behavior

Trivy reports some vulnerabilities, all of which can be addressed by using the latest version of go.

$ docker run -it aquasec/trivy:0.51.1 image gcr.io/paketo-buildpacks/bellsoft-liberica
2024-05-15T16:51:40Z	INFO	Need to update DB
2024-05-15T16:51:40Z	INFO	Downloading DB...	repository="ghcr.io/aquasecurity/trivy-db:2"
46.24 MiB / 46.24 MiB [-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 10.48 MiB p/s 4.6s
2024-05-15T16:51:45Z	INFO	Vulnerability scanning is enabled
2024-05-15T16:51:45Z	INFO	Secret scanning is enabled
2024-05-15T16:51:45Z	INFO	If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-05-15T16:51:45Z	INFO	Please see also https://aquasecurity.github.io/trivy/v0.51/docs/scanner/secret/#recommendation for faster secret detection
2024-05-15T16:51:46Z	INFO	Number of language-specific files	num=2
2024-05-15T16:51:46Z	INFO	[gobinary] Detecting vulnerabilities...

cnb/buildpacks/paketo-buildpacks_bellsoft-liberica/10.7.1/bin/helper (gobinary)

Total: 6 (UNKNOWN: 0, LOW: 0, MEDIUM: 5, HIGH: 1, CRITICAL: 0)

┌─────────┬────────────────┬──────────┬────────┬───────────────────┬────────────────┬─────────────────────────────────────────────────────────────┐
│ Library │ Vulnerability  │ Severity │ Status │ Installed Version │ Fixed Version  │                            Title                            │
├─────────┼────────────────┼──────────┼────────┼───────────────────┼────────────────┼─────────────────────────────────────────────────────────────┤
│ stdlib  │ CVE-2023-45288 │ HIGH     │ fixed  │ 1.20.14           │ 1.21.9, 1.22.2 │ golang: net/http, x/net/http2: unlimited number of          │
│         │                │          │        │                   │                │ CONTINUATION frames causes DoS                              │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2023-45288                  │
│         ├────────────────┼──────────┤        │                   ├────────────────┼─────────────────────────────────────────────────────────────┤
│         │ CVE-2023-45289 │ MEDIUM   │        │                   │ 1.21.8, 1.22.1 │ golang: net/http/cookiejar: incorrect forwarding of         │
│         │                │          │        │                   │                │ sensitive headers and cookies on HTTP redirect...           │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2023-45289                  │
│         ├────────────────┤          │        │                   │                ├─────────────────────────────────────────────────────────────┤
│         │ CVE-2023-45290 │          │        │                   │                │ golang: net/http: memory exhaustion in                      │
│         │                │          │        │                   │                │ Request.ParseMultipartForm                                  │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2023-45290                  │
│         ├────────────────┤          │        │                   │                ├─────────────────────────────────────────────────────────────┤
│         │ CVE-2024-24783 │          │        │                   │                │ golang: crypto/x509: Verify panics on certificates with an  │
│         │                │          │        │                   │                │ unknown public key algorithm...                             │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2024-24783                  │
│         ├────────────────┤          │        │                   │                ├─────────────────────────────────────────────────────────────┤
│         │ CVE-2024-24784 │          │        │                   │                │ golang: net/mail: comments in display names are incorrectly │
│         │                │          │        │                   │                │ handled                                                     │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2024-24784                  │
│         ├────────────────┤          │        │                   │                ├─────────────────────────────────────────────────────────────┤
│         │ CVE-2024-24785 │          │        │                   │                │ golang: html/template: errors returned from MarshalJSON     │
│         │                │          │        │                   │                │ methods may break template escaping                         │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2024-24785                  │
└─────────┴────────────────┴──────────┴────────┴───────────────────┴────────────────┴─────────────────────────────────────────────────────────────┘

cnb/buildpacks/paketo-buildpacks_bellsoft-liberica/10.7.1/bin/main (gobinary)

Total: 6 (UNKNOWN: 0, LOW: 0, MEDIUM: 5, HIGH: 1, CRITICAL: 0)

┌─────────┬────────────────┬──────────┬────────┬───────────────────┬────────────────┬─────────────────────────────────────────────────────────────┐
│ Library │ Vulnerability  │ Severity │ Status │ Installed Version │ Fixed Version  │                            Title                            │
├─────────┼────────────────┼──────────┼────────┼───────────────────┼────────────────┼─────────────────────────────────────────────────────────────┤
│ stdlib  │ CVE-2023-45288 │ HIGH     │ fixed  │ 1.20.14           │ 1.21.9, 1.22.2 │ golang: net/http, x/net/http2: unlimited number of          │
│         │                │          │        │                   │                │ CONTINUATION frames causes DoS                              │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2023-45288                  │
│         ├────────────────┼──────────┤        │                   ├────────────────┼─────────────────────────────────────────────────────────────┤
│         │ CVE-2023-45289 │ MEDIUM   │        │                   │ 1.21.8, 1.22.1 │ golang: net/http/cookiejar: incorrect forwarding of         │
│         │                │          │        │                   │                │ sensitive headers and cookies on HTTP redirect...           │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2023-45289                  │
│         ├────────────────┤          │        │                   │                ├─────────────────────────────────────────────────────────────┤
│         │ CVE-2023-45290 │          │        │                   │                │ golang: net/http: memory exhaustion in                      │
│         │                │          │        │                   │                │ Request.ParseMultipartForm                                  │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2023-45290                  │
│         ├────────────────┤          │        │                   │                ├─────────────────────────────────────────────────────────────┤
│         │ CVE-2024-24783 │          │        │                   │                │ golang: crypto/x509: Verify panics on certificates with an  │
│         │                │          │        │                   │                │ unknown public key algorithm...                             │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2024-24783                  │
│         ├────────────────┤          │        │                   │                ├─────────────────────────────────────────────────────────────┤
│         │ CVE-2024-24784 │          │        │                   │                │ golang: net/mail: comments in display names are incorrectly │
│         │                │          │        │                   │                │ handled                                                     │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2024-24784                  │
│         ├────────────────┤          │        │                   │                ├─────────────────────────────────────────────────────────────┤
│         │ CVE-2024-24785 │          │        │                   │                │ golang: html/template: errors returned from MarshalJSON     │
│         │                │          │        │                   │                │ methods may break template escaping                         │
│         │                │          │        │                   │                │ https://avd.aquasec.com/nvd/cve-2024-24785                  │
└─────────┴────────────────┴──────────┴────────┴───────────────────┴────────────────┴─────────────────────────────────────────────────────────────┘

Possible Solution

I suggest that the version of go be updated to the latest version (currently 1.22.3).

Steps to Reproduce

  1. docker run -it aquasec/trivy:0.51.1 image gcr.io/paketo-buildpacks/bellsoft-liberica

Motivations

I don't think these vulnerabilities are exploitable, but they're still present which isn't great. And their presence causes a lot of trouble for those who use automated security scanning systems as such users must suppress these findings.

Support JDK 18

What happened?

cannot build spring-boot image

  • What were you attempting to do?
    Trying to build an image using spring-boot/gradle under JDK 18

  • What did you expect to happen?
    spring-boot image was build

  • What was the actual behavior? Please provide log output, if possible.

Build Configuration

Log output

[INFO]     [creator]         $BPL_DEBUG_PORT              8000            configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false           configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                          write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true            enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary         configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false           enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false           enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000            configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0               the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes  the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250             the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                           the JVM launch flags
[INFO]     [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO]     [creator]     
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 9.2.0
[INFO]     [creator]       unable to find dependency
[INFO]     [creator]       no valid dependencies for jdk, 18, and io.buildpacks.stacks.bionic in [(jdk, 8.0.322, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 8.0.322, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 11.0.14, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 11.0.14, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (native-image-svm, 11.0.14, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 17.0.2, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 17.0.2, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (native-image-svm, 17.0.2, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *])]
[INFO]     [creator]     ERROR: failed to build: exit status 1

See also #127

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

Source to image support in cloudfoundry

Hi, I was trying a heroku like source to image push to CF using your build pack facing an issue:

2020-10-29T14:50:46.943+01:00 [STG/0] [ERR] Failed to compile droplet: Failed to compile droplet: fork/exec /tmp/buildpackdownloads/c69d89b7da1b62d309e1261ab5d0ab30/bin/compile: no such file or directory

Is it supported? was doing this for fun latest version of PCF used for test.

I had to build the build pack from source using:

Maybe there is something I am doing wrong?

My original idea was to run:

cf push cf-demo --buildpack https://github.com/paketo-buildpacks/bellsoft-liberica/archive/v5.1.0.zip

Differences in SHA in buildpack

Could I kindly ask, it would be very much appreciated, if you could rebuild the buildpack and issue a new release?

I have updated the buildpack from cloudfoundry/cnb:bionic:
pack build triathlonguy/todos-api --publish --path . **--builder gcr.io/paketo-buildpacks/builder:base** --env BP_BUILT_MODULE=todos-api --env BP_BUILD_ARGUMENTS="-Dmaven.test.skip=false package -pl todos-api -am"

The link to the Git commit.

Pack fails as follows:

pack build triathlonguy/todos-api --publish --path . --builder gcr.io/paketo-buildpacks/builder:base --env BP_BUILT_MODULE=todos-api --env BP_BUILD_ARGUMENTS="-Dmaven.test.skip=false package -pl todos-api -am"
base: Pulling from paketo-buildpacks/builder
Digest: sha256:baaf85bc39cb43e364630625590c13b921b7bcfbfd4b30c6d8dfabd56024e6a5
Status: Image is up to date for gcr.io/paketo-buildpacks/builder:base
===> DETECTING
[detector] ERROR: No buildpack groups passed detection.
[detector] ERROR: Please check that you are running against the correct path.
[detector] ERROR: failed to detect: no buildpacks participating
ERROR: failed with status code: 6

kpack fails with the same buildpack as follows:

[build] Paketo BellSoft Liberica Buildpack 2.2.0
[build]     Set $BP_JAVA_VERSION to configure the Java version. Default 11.*.
[build]     Set $BPL_HEAD_ROOM to configure the headroom in memory calculation. Default 0.
[build]     Set $BPL_LOADED_CLASS_COUNT to configure the number of loaded classes in memory calculation. Default 35% of classes.
[build]     Set $BPL_THREAD_COUNT to configure the number of threads in memory calculation. Default 250.
[build]   BellSoft Liberica JDK 8.0.252: Contributing to layer
[build]     Downloading from https://github.com/bell-sw/Liberica/releases/download/8u252+9/bellsoft-jdk8u252+9-linux-amd64.tar.gz
[build]     Verifying checksum
[build] unable to invoke layer creator
[build] unable to get dependency jdk
[build] sha256 for /tmp/0654d01fbf03e0bf34606d416fccf05552a8a71c9776535b3dad583c9fe654cc/bellsoft-jdk8u252+9-linux-amd64.tar.gz cbf38656ae0e0f8dc47e810430498d85f08331e8c84aafc3aa1cd2ceb83cf409 does not match expected 0654d01fbf03e0bf34606d416fccf05552a8a71c9776535b3dad583c9fe654cc
[build] ERROR: failed to build: exit status 1

Build failing when pinning JVM version to older version via BP_JVM_VERSION

I'd like to get deterministic builds. That why I used the BP_JVM_VERSION env var to pin the JVM version to 11.0.7.
This worked well at first but suddenly the builds breaks: no valid dependencies for jdk (complete output at the end).

I presume this has to do with the most recent version being 11.0.8 now.
Removing the env var solves the problem but also results in non-deterministic builds.

I can see that the JRE/JDK are downloaded from here, where 11.0.7 is still available.
It's also worth mentioning that the spring boot docs explicitly mention this use case of setting a non-wildcard version.

So I think this must be a bug. Hopefully this is the correct repo to report.

Complete log output:

[INFO]  > Running creator
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     5 of 15 buildpacks participating
[INFO]     [creator]     paketo-buildpacks/bellsoft-liberica 2.10.0
[INFO]     [creator]     paketo-buildpacks/executable-jar    2.0.1
[INFO]     [creator]     paketo-buildpacks/apache-tomcat     1.3.3
[INFO]     [creator]     paketo-buildpacks/dist-zip          1.3.7
[INFO]     [creator]     paketo-buildpacks/spring-boot       2.1.0
[INFO]     [creator]     ===> ANALYZING
[INFO]     [creator]     Previous image with name "REMOVED" not found
[INFO]     [creator]     ===> RESTORING
[INFO]     [creator]     ===> BUILDING
[INFO]     [creator]     
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 2.10.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_VERSION              11.0.7          the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0               the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes  the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250             the number of threads in memory calculation
[INFO]     [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO]     [creator]     
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 2.10.0
[INFO]     [creator]       unable to find dependency
[INFO]     [creator]       no valid dependencies for jdk, 11.0.7, and io.buildpacks.stacks.bionic in [(jre, 8.0.262, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 11.0.8, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 14.0.2, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 8.0.262, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 11.0.8, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 14.0.2, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jvmkill, 1.16.0, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (memory-calculator, 4.1.0, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3])]
[INFO]     [creator]     ERROR: failed to build: exit status 1

Does remote debug support for bellsoft NIK?

When using JDK, we can set BPL_DEBUG_PORT and BPL_DEBUG_ENABLED to enable remote debugging by JVM.

When deploying Java native image, does Bellsoft NIK support remote debugging?
From GraalVM debug doc, I think it's not support to enable remote debug by configuring debug port right?

And I think using -g to enable gdb debug is not suitable for us

Or do you know if there is any way to enable remote debugging, I can configure the remote debugging port and use IDE to attach the port when deploying Java native image.

Native memory tracking can't be disabled

When BPL_JAVA_NMT_ENABLED is set to false, Native Memory Tracking is still enabled when running container.

[INFO]     [creator]     Paketo Buildpack for BellSoft Liberica 10.2.3
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
[INFO]     [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              20.*                                                         the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           false                                                        enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        false                                                        enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail
docker run -it --rm application:1.0-SNAPSHOT
Setting Active Processor Count to 20
Calculating JVM memory based on 48729092K available memory
For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx48092834K -XX:MaxMetaspaceSize=124257K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 48729092K, Thread Count: 250, Loaded Class Count: 19524, Headroom: 0%)
Enabling Java Native Memory Tracking
Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -XX:+ExitOnOutOfMemoryError -XX:ActiveProcessorCount=20 -XX:MaxDirectMemorySize=10M -Xmx48092834K -XX:MaxMetaspaceSize=124257K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics

Expected Behavior

I expect NMT to be turned of completely when BPL_JAVA_NMT_ENABLED is set to false.

Automatic Thread Count

Describe the Enhancement

Given JVM virtual threads (Loom) and other non-blocking JVM approaches, it'd be nice to have an option to automatically manage the thread count based on the number of system cores, similar to how memory can be determined at runtime by the memory calculator.

Possible Solution

Maybe a parameter like BP_USES_VIRTUAL_THREADS as a boolean. When true it sets the thread count to the number of system cores.

Support for JVM-based apps using musl based JVM & the static stack

Our team is willing to use buildpacks to build our docker images which requires using Alpine for security reasons.
Current bellsoft-liberica buildpack (and actually any other java distro buildpack) doesn't support Alpine, due to use of JRE and JDK which depend on libc.
Alpine uses musl as an alternative to libc.

Describe the Enhancement

I would like that out-of-the-box liberica buildpack will support Alpine OS.
Example usage could be, using Springboot gradle plugin to build Springboot images which are based on Alpine instead of Ubuntu.
If needed we can configure the decision of libc/musl using environment variable such as BP_JAVA_MUSL.

Possible Solution

I tested locally and seems like it can be enough to add the java distro based on musl as an additional metadata.dependencies block in buildpack.toml file.
It is not very clear to me how the decision of the dependency is done, but we can add the above mentioned env var if needed.

Motivation

As mentioned before, we use Alpine for security reasons.
Alpine's attack surface is considered much narrower than Ubuntu or other Linux disros and it is one of the most commonly used OS in cloud services due to it's very small image size.
Using Alpine to run java applications can be very useful to people who wish to run many containers as it requires less storage and it is considered very lightweight.

Error when building using Java 18

What happened?

Unable to build image using spring-boot/maven using JDK 18.

  • What were you attempting to do? Build via spring boot

  • What did you expect to happen? A build using Java 18 to success

  • What was the actual behavior? Please provide log output, if possible.

[INFO]     [creator]     Paketo CA Certificates Buildpack 3.1.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/ca-certificates
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[INFO]     [creator]     
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 9.2.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                  the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              18.*                 the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           false                enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000                 configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                               write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true                 enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary              configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                     configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false                enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false                enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000                 configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0                    the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes       the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250                  the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS           -Xms2048m -Xmx2048m  the JVM launch flags
[INFO]     [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO]     [creator]     
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 9.2.0
[INFO]     [creator]       unable to find dependency
[INFO]     [creator]       no valid dependencies for jdk, 18.*, and io.buildpacks.stacks.bionic in [(jdk, 8.0.322, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 8.0.322, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 11.0.14, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 11.0.14, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (native-image-svm, 11.0.14, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 17.0.2, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 17.0.2, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (native-image-svm, 17.0.2, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *])]
[INFO]     [creator]     ERROR: failed to build: exit status 1

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Using spring-boot-maven-plugin latest.

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

Support JDK 19

> Running creator
    [creator]     Previous image with name "harbor.inoviagroup.se/v2t/v2t-transcription:commit-166be756b48bf7aaa324842c5f4cb02356cc1100" not found
    [creator]     ===> DETECTING
    [creator]     6 of 24 buildpacks participating
    [creator]     paketo-buildpacks/ca-certificates   3.4.0
    [creator]     paketo-buildpacks/bellsoft-liberica 9.7.0
    [creator]     paketo-buildpacks/syft              1.20.0
    [creator]     paketo-buildpacks/executable-jar    6.5.0
    [creator]     paketo-buildpacks/dist-zip          5.4.0
    [creator]     paketo-buildpacks/spring-boot       5.19.0
    [creator]     ===> RESTORING
    [creator]     ===> BUILDING
    [creator]     
    [creator]     Paketo Buildpack for CA Certificates 3.4.0
    [creator]       https://github.com/paketo-buildpacks/ca-certificates
    [creator]       Launch Helper: Contributing to layer
    [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
    [creator]     
    [creator]     Paketo Buildpack for BellSoft Liberica 9.7.0
    [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
    [creator]       Build Configuration:
    [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
    [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
    [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
    [creator]         $BP_JVM_VERSION              19.*                                                         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]         Using Java version 19.* from BP_JVM_VERSION
    [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
    [creator]        : Contributing to layer
    [creator]       Warning: Dependency has no SHA256. Skipping cache.
    [creator]         Downloading from 
    [creator]     unable to invoke layer creator
    [creator]     unable to get dependency 
    [creator]     unable to download 
    [creator]     unable to request 
    [creator]     Get "": unsupported protocol scheme ""
    [creator]     ERROR: failed to build: exit status 1

JDK 19 is already released it seems: https://bell-sw.com/pages/downloads/#/java-19-current

No valid JRE available

Greetings,

I've looked through the issues history and found similar tickets in the past, but there seems to not be a very clear solution in any of them.

Context - I am building a Docker image for a Kotlin Spring Boot App using Maven (mvn spring-boot:build-image) goal and this is the log that I receive:

[INFO]  > Running creator
[INFO]     [creator]     ===> ANALYZING
[INFO]     [creator]     Image with name "docker.io/library/powely:latest" not found
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     6 of 26 buildpacks participating
[INFO]     [creator]     paketo-buildpacks/ca-certificates   3.6.1
[INFO]     [creator]     paketo-buildpacks/bellsoft-liberica 10.2.0
[INFO]     [creator]     paketo-buildpacks/syft              1.28.0
[INFO]     [creator]     paketo-buildpacks/executable-jar    6.6.3
[INFO]     [creator]     paketo-buildpacks/dist-zip          5.5.2
[INFO]     [creator]     paketo-buildpacks/spring-boot       5.23.0
[INFO]     [creator]     ===> RESTORING
[INFO]     [creator]     ===> BUILDING
[INFO]     [creator]     
[INFO]     [creator]     Paketo Buildpack for CA Certificates 3.6.1
[INFO]     [creator]       https://github.com/paketo-buildpacks/ca-certificates
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[INFO]     [creator]     
[INFO]     [creator]     Paketo Buildpack for BellSoft Liberica 10.2.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
[INFO]     [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              19.*                                                         the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           false                                                        enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true                                                         enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                                                             configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false                                                        enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false                                                        enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000                                                         configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0                                                            the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes                                               the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250                                                          the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags
[INFO]     [creator]         Using Java version 19.* from BP_JVM_VERSION
[INFO]     [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO]     [creator]        : Contributing to layer
[INFO]     [creator]       Warning: Dependency has no SHA256. Skipping cache.
[INFO]     [creator]         Downloading from 
[INFO]     [creator]     unable to invoke layer creator
[INFO]     [creator]     unable to get dependency 
[INFO]     [creator]     unable to download 
[INFO]     [creator]     unable to request 
[INFO]     [creator]     Get "": unsupported protocol scheme ""
[INFO]     [creator]     ERROR: failed to build: exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:16 min
[INFO] Finished at: 2023-04-24T07:25:12Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.0:build-image (default-cli) on project backend: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.7.0:build-image failed: Builder lifecycle 'creator' failed with status code 51 -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Error: Process completed with exit code 1.

In my understanding, the problematic line is - "No valid JRE available, providing matching JDK instead." It appears that BellSoft Liberica JRE is not downloaded.
My current configuration used to work, but stopped without any changes on my side. I assume it's the newer version of the buildpack that might be causing this.

What I tried:

  • Change Spring Boot version;
  • Explicitly specify an earlier buildpack version;
  • Try to include JRE in the builder;
  • Clear cache;

For reference, this is the last working execution of the same Maven goal from a week ago:

> Running creator
[INFO]     [creator]     ===> ANALYZING
[INFO]     [creator]     Previous image with name "docker.io/library/powely:latest" not found
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     6 of 24 buildpacks participating
[INFO]     [creator]     paketo-buildpacks/ca-certificates   3.5.1
[INFO]     [creator]     paketo-buildpacks/bellsoft-liberica 9.10.3
[INFO]     [creator]     paketo-buildpacks/syft              1.24.2
[INFO]     [creator]     paketo-buildpacks/executable-jar    6.6.0
[INFO]     [creator]     paketo-buildpacks/dist-zip          5.5.0
[INFO]     [creator]     paketo-buildpacks/spring-boot       5.22.1
[INFO]     [creator]     ===> RESTORING
[INFO]     [creator]     ===> BUILDING
[INFO]     [creator]     
[INFO]     [creator]     Paketo Buildpack for CA Certificates 3.5.1
[INFO]     [creator]       https://github.com/paketo-buildpacks/ca-certificates
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[INFO]     [creator]     
[INFO]     [creator]     Paketo Buildpack for BellSoft Liberica 9.10.3
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
[INFO]     [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              19.*                                                         the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           false                                                        enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true                                                         enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                                                             configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false                                                        enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false                                                        enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000                                                         configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0                                                            the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes                                               the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250                                                          the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags
[INFO]     [creator]         Using Java version 19.* from BP_JVM_VERSION
[INFO]     [creator]       BellSoft Liberica JRE 19.0.2: Contributing to layer
[INFO]     [creator]         Downloading from https://github.com/bell-sw/Liberica/releases/download/19.0.2+9/bellsoft-jre19.0.2+9-linux-amd64.tar.gz
[INFO]     [creator]         Verifying checksum
[INFO]     [creator]         Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
[INFO]     [creator]         Warning: The JVM cacerts entries cannot be loaded with Java 18+, for more information see: https://github.com/paketo-buildpacks/libjvm/issues/158
[INFO]     [creator]         Writing env.launch/BPI_APPLICATION_PATH.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_CACERTS.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_CLASS_COUNT.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_SECURITY_PROVIDERS.default
[INFO]     [creator]         Writing env.launch/JAVA_HOME.default
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.append
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.delim
[INFO]     [creator]         Writing env.launch/MALLOC_ARENA_MAX.default
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/active-processor-count
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/java-opts
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jvm-heap
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/link-local-dns
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-configurer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jmx
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jfr
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-classpath-9
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/debug-9
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/nmt
[INFO]     [creator]       Java Security Properties: Contributing to layer
[INFO]     [creator]         Writing env.launch/JAVA_SECURITY_PROPERTIES.default
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.append
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.delim

Would really appreciate any help in solving this and also in preventing this in the future.

Thank you very much in advance!

When using jlink, we can't use --add-modules ALL-MODULE-PATH

When using --add-modules ALL-MODULE-PATH as jlink arg to add all modules to the jre, the build fails with: Error: Module all-module-path not found. Note the lowercase here

Expected Behavior

Build should work

Possible Solution

Maybe there is some toLowerCase() call?

Steps to Reproduce

  1. add BP_JVM_JLINK_ENABLED: true
  2. add BP_JVM_JLINK_ARGS: --add-modules ALL-MODULE-PATH --compress=2 --no-header-files --no-man-pages --strip-debug

Motivations

We wanna test and get a feeling for jlink. Currently our application is not modulrized, so we wanna start by trimming the modules from all modules. It also is mentioned in jlink help section to use that shortcut:

image

Support ARM JVM builds

What happened?

  • I was trying to run a spring built image on a Raspberry Pi and realized that it can't run on ARM Devices.

  • I thought it should be possible to configure the buildpack to use ARM builds of the JVM.

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version: org.springframework.boot 2.4.1

  • What buildpacks are you using? Please include versions.

  • paketo-buildpacks/ca-certificates 2.1.0
    paketo-buildpacks/bellsoft-liberica 7.1.0
    paketo-buildpacks/executable-jar 5.0.0
    paketo-buildpacks/dist-zip 4.0.0
    paketo-buildpacks/spring-boot 4.1.0

Missing library in java image when awt is used

What happened?

Hello,

I hope that this is the right place to discuss this topic. Our application uses Spring Boot 2.5.6. Maven builds our application as Spring Boot enabled jar file without problems for quite some time. Now, for initial testing of docker container creation, I used

mvn spring-boot:build-image

to try to automatically create a docker image. This worked right out of the box, so I started a container from this image. Our application first starts as it should, but then we are confronted with a stacktrace:

2021-12-07 10:40:33,956 ERROR [            main                   ] o.a.c.c.C.[Tomcat].[localhost].[/]       : Exception starting filter [javamelody]
java.lang.UnsatisfiedLinkError: /layers/paketo-buildpacks_bellsoft-liberica/jdk/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
        at java.base/java.lang.Runtime.load0(Runtime.java:768)
        at java.base/java.lang.System.load(System.java:1837)
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
        at java.base/java.lang.System.loadLibrary(System.java:1873)
        at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1395)
        at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1393)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1392)
        at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1425)
        at java.desktop/java.awt.Color.<clinit>(Color.java:275)
        at net.bull.javamelody.internal.model.JRobin.<clinit>(JRobin.java:71)
        at net.bull.javamelody.FilterContext.initCollect(FilterContext.java:271)
        at net.bull.javamelody.FilterContext.<init>(FilterContext.java:137)
        at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:148)
        at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4613)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
        at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123)
        at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104)
        at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:450)
        at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:199)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
        at de.foconis.core.app.SysUtils.run(SysUtils.java:289)
        at de.foconis.core.app.SysUtils.run(SysUtils.java:109)
        at de.foconis.zak.runner.ApplicationInitializer.main(ApplicationInitializer.java:58)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)

JavaMelody is integrated into our application and it is initialized during bootup. When I look into JRobin.java:71, I see:

private static final Color PERCENTILE_COLOR = new Color(200, 50, 50);`

Judging from the imports, this class needs a few other awt classes as well:

import java.awt.Color;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Paint;

So when intializing this class, it tries to load the libawt_xawt.so library, which in turn tries to load libXtst.so.6, which is not present in the image. I also tested it with the full image, but I get the same error.

It seems to me, that there is a library missing in the base image that Java needs to function properly. Can this be integrated into one of the images?

Build Configuration

We use spring-boot-2.5.6 as basic framework. These are the configuration changes of the spring-boot-maven-plugin (I tested it with base and full, therefore the comment, I tested it without the whole image-Block as well):

<image>
	<!--<builder>paketobuildpacks/builder:full</builder>-->
	<env>
		<BP_JVM_TYPE>JDK</BP_JVM_TYPE>
		<BP_JVM_VERSION>11.*</BP_JVM_VERSION>
		<BPL_DEBUG_ENABLED>true</BPL_DEBUG_ENABLED>
		<BPL_HEAP_DUMP_PATH>/tmp/heapdump.hprof</BPL_HEAP_DUMP_PATH>
	</env>
</image>

I see this output when running spring-boot:build-image:

[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder:base' 100%
[INFO]  > Pulled builder image 'paketobuildpacks/builder@sha256:5f5b269e93b0519f993562b0560ba73fbf24f50d3fe4a5f62ba40cb323571fa0'
[INFO]  > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' 100%
[INFO]  > Pulled run image 'paketobuildpacks/run@sha256:b1e8add4fc569e37085342cd05186d17cb81e128ee60fd9fd633337e25ac7808'
[INFO]  > Executing lifecycle version v0.13.1
[INFO]  > Using build cache volume 'pack-cache-bc545c05cd44.build'
[INFO]
[INFO]  > Running creator
[INFO] Layout: WAR
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     6 of 19 buildpacks participating
[INFO]     [creator]     paketo-buildpacks/ca-certificates   3.0.1
[INFO]     [creator]     paketo-buildpacks/bellsoft-liberica 9.0.1
[INFO]     [creator]     paketo-buildpacks/syft              1.0.1
[INFO]     [creator]     paketo-buildpacks/executable-jar    6.0.1
[INFO]     [creator]     paketo-buildpacks/dist-zip          5.0.1
[INFO]     [creator]     paketo-buildpacks/spring-boot       5.1.0
[INFO]     [creator]     ===> ANALYZING
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jdk" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/bellsoft-liberica:helper" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/bellsoft-liberica:java-security-properties" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/spring-boot:helper" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/spring-boot:spring-cloud-bindings" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/spring-boot:web-application-type" from app image
[INFO]     [creator]     ===> RESTORING
[INFO]     [creator]     Restoring data for "paketo-buildpacks/bellsoft-liberica:jdk" from cache
[INFO]     [creator]     Restoring data for "paketo-buildpacks/syft:syft" from cache
[INFO]     [creator]     ===> BUILDING
[INFO]     [creator]
[INFO]     [creator]     Paketo CA Certificates Buildpack 3.0.1
[INFO]     [creator]       https://github.com/paketo-buildpacks/ca-certificates
[INFO]     [creator]       Launch Helper: Reusing cached layer
[INFO]     [creator]
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 9.0.1
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_TYPE                 JDK                  the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              11.*                 the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           true                 enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000                 configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH          /tmp/heapdump.hprof  write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true                 enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary              configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                     configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false                enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false                enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000                 configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0                    the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes       the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250                  the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                                the JVM launch flags
[INFO]     [creator]       A JDK was specifically requested by the user, however a JRE is available. Using a JDK at runtime has security implications.
[INFO]     [creator]       BellSoft Liberica JDK 11.0.13: Reusing cached layer
[INFO]     [creator]       Launch Helper: Reusing cached layer
[INFO]     [creator]       Java Security Properties: Reusing cached layer
[INFO]     [creator]
[INFO]     [creator]     Paketo Syft Buildpack 1.0.1
[INFO]     [creator]       https://github.com/paketo-buildpacks/syft
[INFO]     [creator]
[INFO]     [creator]     Paketo Executable JAR Buildpack 6.0.1
[INFO]     [creator]       https://github.com/paketo-buildpacks/executable-jar
[INFO]     [creator]       Class Path: Contributing to layer
[INFO]     [creator]         Writing env/CLASSPATH.delim
[INFO]     [creator]         Writing env/CLASSPATH.prepend
[INFO]     [creator]       Process types:
[INFO]     [creator]         executable-jar: java org.springframework.boot.loader.WarLauncher (direct)
[INFO]     [creator]         task:           java org.springframework.boot.loader.WarLauncher (direct)
[INFO]     [creator]         web:            java org.springframework.boot.loader.WarLauncher (direct)
[INFO]     [creator]
[INFO]     [creator]     Paketo Spring Boot Buildpack 5.1.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/spring-boot
[INFO]     [creator]       Creating slices from layers index
[INFO]     [creator]         dependencies
[INFO]     [creator]         spring-boot-loader
[INFO]     [creator]         snapshot-dependencies
[INFO]     [creator]         application
[INFO]     [creator]       Launch Helper: Reusing cached layer
[INFO]     [creator]       Spring Cloud Bindings 1.8.0: Reusing cached layer
[INFO]     [creator]       Web Application Type: Contributing to layer
[INFO]     [creator]         Non-web application detected
[INFO]     [creator]         Writing env.launch/BPL_JVM_THREAD_COUNT.default
[INFO]     [creator]       4 application slices
[INFO]     [creator]       Image labels:
[INFO]     [creator]         org.springframework.boot.version
[INFO]     [creator]     ===> EXPORTING
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/ca-certificates:helper'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/bellsoft-liberica:helper'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/bellsoft-liberica:java-security-properties'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/bellsoft-liberica:jdk'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/executable-jar:classpath'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/spring-boot:helper'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/spring-boot:spring-cloud-bindings'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/spring-boot:web-application-type'
[INFO]     [creator]     Reusing 4/5 app layer(s)
[INFO]     [creator]     Adding 1/5 app layer(s)
[INFO]     [creator]     Reusing layer 'launcher'
[INFO]     [creator]     Reusing layer 'config'
[INFO]     [creator]     Reusing layer 'process-types'
[INFO]     [creator]     Adding label 'io.buildpacks.lifecycle.metadata'
[INFO]     [creator]     Adding label 'io.buildpacks.build.metadata'
[INFO]     [creator]     Adding label 'io.buildpacks.project.metadata'
[INFO]     [creator]     Adding label 'org.springframework.boot.version'
[INFO]     [creator]     Setting default process type 'web'
[INFO]     [creator]     Saving docker.io/library/foconis-zak-war:1.43.0-RC5-SNAPSHOT...
[INFO]     [creator]     *** Images (795c8545a3bb):
[INFO]     [creator]           docker.io/library/foconis-zak-war:1.43.0-RC5-SNAPSHOT
[INFO]     [creator]     Reusing cache layer 'paketo-buildpacks/bellsoft-liberica:jdk'
[INFO]     [creator]     Reusing cache layer 'paketo-buildpacks/syft:syft'
[INFO]
[INFO] Successfully built image 'docker.io/library/foconis-zak-war:1.43.0-RC5-SNAPSHOT'

All of that was tested in Debian 11.1 running in WSL2.

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

gradle `bootBuildImage` fails due to paketo-buildpacks/bellsoft-liberica

We are using the Gradle target bootBuildImage by Spring Boot 3 to build Docker images for our app. Since yesterday (so since your release of 10.1), this fails. We changed nothing on our side.

Expected Behavior

It works :)

Those are logs from a successful old run on Github:

2023-04-11T11:26:16.3849915Z  > Running creator
2023-04-11T11:26:17.3887204Z     [creator]     ===> ANALYZING
2023-04-11T11:26:17.4845334Z     [creator]     Image with name "ghcr.io/genspectrum/lapis-v2:simpleVariantQuery" not found
2023-04-11T11:26:17.4846074Z     [creator]     ===> DETECTING
2023-04-11T11:26:18.1845855Z     [creator]     6 of 26 buildpacks participating
2023-04-11T11:26:18.1846918Z     [creator]     paketo-buildpacks/ca-certificates   3.6.0
2023-04-11T11:26:18.1954923Z     [creator]     paketo-buildpacks/bellsoft-liberica 10.0.0
2023-04-11T11:26:18.1955490Z     [creator]     paketo-buildpacks/syft              1.26.0
2023-04-11T11:26:18.1957145Z     [creator]     paketo-buildpacks/executable-jar    6.6.2
2023-04-11T11:26:18.1957602Z     [creator]     paketo-buildpacks/dist-zip          5.5.2
2023-04-11T11:26:18.1958012Z     [creator]     paketo-buildpacks/spring-boot       5.23.0
2023-04-11T11:26:18.1958325Z     [creator]     ===> RESTORING
2023-04-11T11:26:18.1958599Z     [creator]     ===> BUILDING
2023-04-11T11:26:18.1958842Z     [creator]     
2023-04-11T11:26:18.1959165Z     [creator]     Paketo Buildpack for CA Certificates 3.6.0
2023-04-11T11:26:18.1959641Z     [creator]       https://github.com/paketo-buildpacks/ca-certificates
2023-04-11T11:26:18.1960015Z     [creator]       Launch Helper: Contributing to layer
2023-04-11T11:26:18.1960554Z     [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
2023-04-11T11:26:18.1961097Z     [creator]     
2023-04-11T11:26:18.1961442Z     [creator]     Paketo Buildpack for BellSoft Liberica 10.0.0
2023-04-11T11:26:18.1961983Z     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
2023-04-11T11:26:18.1962381Z     [creator]       Build Configuration:
2023-04-11T11:26:18.1963095Z     [creator]         $BP_JVM_JLINK_ARGS           --no-manpages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
2023-04-11T11:26:18.1964270Z     [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
2023-04-11T11:26:18.1964980Z     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
2023-04-11T11:26:18.1965464Z     [creator]         $BP_JVM_VERSION              17                                                           the Java version
2023-04-11T11:26:18.1965878Z     [creator]       Launch Configuration:
2023-04-11T11:26:18.1966343Z     [creator]         $BPL_DEBUG_ENABLED           false                                                        enables Java remote debugging support
2023-04-11T11:26:18.1966897Z     [creator]         $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port
2023-04-11T11:26:18.1967483Z     [creator]         $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached
2023-04-11T11:26:18.1968077Z     [creator]         $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path
2023-04-11T11:26:18.1968640Z     [creator]         $BPL_JAVA_NMT_ENABLED        true                                                         enables Java Native Memory Tracking (NMT)
2023-04-11T11:26:18.1969194Z     [creator]         $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail
2023-04-11T11:26:18.1969773Z     [creator]         $BPL_JFR_ARGS                                                                             configure custom Java Flight Recording (JFR) arguments
2023-04-11T11:26:18.1970322Z     [creator]         $BPL_JFR_ENABLED             false                                                        enables Java Flight Recording (JFR)
2023-04-11T11:26:18.1971537Z     [creator]         $BPL_JMX_ENABLED             false                                                        enables Java Management Extensions (JMX)
2023-04-11T11:26:18.1974604Z     [creator]         $BPL_JMX_PORT                5000                                                         configure the JMX port
2023-04-11T11:26:18.1975112Z     [creator]         $BPL_JVM_HEAD_ROOM           0                                                            the headroom in memory calculation
2023-04-11T11:26:18.1975691Z     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes                                               the number of loaded classes in memory calculation
2023-04-11T11:26:18.1976267Z     [creator]         $BPL_JVM_THREAD_COUNT        250                                                          the number of threads in memory calculation
2023-04-11T11:26:18.1976776Z     [creator]         $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags
2023-04-11T11:26:18.1977265Z     [creator]         Using Java version 19 extracted from MANIFEST.MF
2023-04-11T11:26:18.1977714Z     [creator]       BellSoft Liberica JRE 19.0.2: Contributing to layer
2023-04-11T11:26:18.1978518Z     [creator]         Downloading from https://github.com/bell-sw/Liberica/releases/download/19.0.2+9/bellsoft-jre19.0.2+9-linux-amd64.tar.gz
2023-04-11T11:26:19.0853453Z     [creator]         Verifying checksum
2023-04-11T11:26:19.1848130Z     [creator]         Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
2023-04-11T11:26:20.8846295Z     [creator]         Warning: The JVM cacerts entries cannot be loaded with Java 18+, for more information see: https://github.com/paketo-buildpacks/libjvm/issues/158
2023-04-11T11:26:21.5866055Z     [creator]         Writing env.launch/BPI_APPLICATION_PATH.default
2023-04-11T11:26:21.5866608Z     [creator]         Writing env.launch/BPI_JVM_CACERTS.default
2023-04-11T11:26:21.5869577Z     [creator]         Writing env.launch/BPI_JVM_CLASS_COUNT.default
2023-04-11T11:26:21.5870570Z     [creator]         Writing env.launch/BPI_JVM_SECURITY_PROVIDERS.default
2023-04-11T11:26:21.5871258Z     [creator]         Writing env.launch/JAVA_HOME.default
2023-04-11T11:26:21.5871697Z     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.append
2023-04-11T11:26:21.5872179Z     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.delim
2023-04-11T11:26:21.5872608Z     [creator]         Writing env.launch/MALLOC_ARENA_MAX.default
2023-04-11T11:26:21.5873023Z     [creator]       Launch Helper: Contributing to layer
2023-04-11T11:26:21.5873921Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/active-processor-count
2023-04-11T11:26:21.5874721Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/java-opts
2023-04-11T11:26:21.5875370Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jvm-heap
2023-04-11T11:26:21.5876040Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/link-local-dns
2023-04-11T11:26:21.5876702Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator
2023-04-11T11:26:21.5877426Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-configurer
2023-04-11T11:26:21.5878082Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jmx
2023-04-11T11:26:21.5878680Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jfr
2023-04-11T11:26:21.5879387Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-classpath-9
2023-04-11T11:26:21.5880056Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/debug-9
2023-04-11T11:26:21.5880660Z     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/nmt
2023-04-11T11:26:21.5881341Z     [creator]       Java Security Properties: Contributing to layer
2023-04-11T11:26:21.5881785Z     [creator]         Writing env.launch/JAVA_SECURITY_PROPERTIES.default
2023-04-11T11:26:21.5882211Z     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.append
2023-04-11T11:26:21.5882632Z     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.delim

Current Behavior

./gradlew bootBuildImage fails:

 ./gradlew bootBuildImage

> Task :bootBuildImage
Building image 'ghcr.io/genspectrum/lapis-v2:latest'

 > Pulling builder image 'docker.io/paketobuildpacks/builder:base' ..................................................
 > Pulled builder image 'paketobuildpacks/builder@sha256:f7f3d91740b51154bdde7d534145e21e37387320cc21e34092edc66c35203311'
 > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' ..................................................
 > Pulled run image 'paketobuildpacks/run@sha256:41443690a2dc36118112db2c4790dc2bc8189926dae9ff91992b78675d0cac39'
 > Executing lifecycle version v0.16.1
 > Using build cache volume 'pack-cache-0ebb606ef682.build'

 > Running creator
    [creator]     ===> ANALYZING
    [creator]     Restoring data for SBOM from previous image
    [creator]     ===> DETECTING
    [creator]     6 of 26 buildpacks participating
    [creator]     paketo-buildpacks/ca-certificates   3.6.1
    [creator]     paketo-buildpacks/bellsoft-liberica 10.1.0
    [creator]     paketo-buildpacks/syft              1.27.0
    [creator]     paketo-buildpacks/executable-jar    6.6.3
    [creator]     paketo-buildpacks/dist-zip          5.5.2
    [creator]     paketo-buildpacks/spring-boot       5.23.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:spring-cloud-bindings" from app image
    [creator]     Restoring metadata for "paketo-buildpacks/spring-boot:web-application-type" from app image
    [creator]     Restoring metadata for "paketo-buildpacks/spring-boot:helper" 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 Buildpack for CA Certificates 3.6.1
    [creator]       https://github.com/paketo-buildpacks/ca-certificates
    [creator]       Launch Helper: Contributing to layer
    [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
    [creator]     
    [creator]     Paketo Buildpack for BellSoft Liberica 10.1.0
    [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
    [creator]       Build Configuration:
    [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
    [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
    [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
    [creator]         $BP_JVM_VERSION              17                                                           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]         Using Java version 19 extracted from MANIFEST.MF
    [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
    [creator]        : Contributing to layer
    [creator]       Warning: Dependency has no SHA256. Skipping cache.
    [creator]         Downloading from 
    [creator]     unable to invoke layer creator
    [creator]     unable to get dependency 
    [creator]     unable to download 
    [creator]     unable to request 
    [creator]     Get "": unsupported protocol scheme ""
    [creator]     ERROR: failed to build: exit status 1

> Task :bootBuildImage FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootBuildImage'.
> Builder lifecycle 'creator' failed with status code 51

In case it helps:

$  java -version
openjdk version "19.0.2" 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)
OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)

Our build.gradle.

Steps to Reproduce

Should be obvious from above.

[spring-boot:build-image] unable to use jdk 13

When trying to build an image from spring-boot's maven plugin in a java 13 project, I get the following error:

[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 2.8.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_VERSION              13.*            the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0               the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes  the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250             the number of threads in memory calculation
[INFO]     [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO]     [creator]
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 2.8.0
[INFO]     [creator]       unable to find dependency
[INFO]     [creator]       no valid dependencies for jdk, 13.*, and io.buildpacks.stacks.bionic in [(jre, 8.0.252, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 11.0.7, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 14.0.1, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 8.0.252, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 11.0.7, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 14.0.1, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jvmkill, 1.16.0, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (memory-calculator, 4.0.0, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3])]
[INFO]     [creator]     ERROR: failed to build: exit status 1

I tried specifying BP_JVM_VERSION with 13.0.1 and 13.* with no success.
Can you all help me please?

(First time with buildpacks so forgive me if it's something easy.)

can't download form download.bell-sw.com

Tring to build native image for opentelemetry example (https://github.com/open-telemetry/opentelemetry-java-examples/blob/main/spring-native/README.md) faced with error while loading base image:

...
    [creator]         Using Java version 17 extracted from MANIFEST.MF
    [creator]       BellSoft Liberica NIK 17.0.7: Contributing to layer
    [creator]         Downloading from https://download.bell-sw.com/vm/23.0.0/bellsoft-liberica-vm-core-openjdk17.0.7+7-23.0.0+1-linux-amd64.tar.gz
    [creator]     unable to invoke layer creator                                                                                                 
    [creator]     unable to get dependency native-image-svm                                                                                      
    [creator]     unable to download https://download.bell-sw.com/vm/23.0.0/bellsoft-liberica-vm-core-openjdk17.0.7+7-23.0.0+1-linux-amd64.tar.gz
    [creator]     could not download https://download.bell-sw.com/vm/23.0.0/bellsoft-liberica-vm-core-openjdk17.0.7+7-23.0.0+1-linux-amd64.tar.gz: 403
    [creator]     ERROR: failed to build: exit status 1

Trying to open in brawser found that https://download.bell-sw.com/ has guarded by cloudflare and it is blocked and as usually no way to reset restriction or understand cause.

So need wide open resource to download from or remove cloudflare guard for https://download.bell-sw.com/vm/ .

Add custom certificate

If I run a build behind a corporate proxy, the download of the JRE fails with the Error: „x509: certificate signed by unknown authority“.
So how can I add the offending certificate into the ssl chain?
I‘m running a ‚buildBootImage‘ task with the new Spring boot 2.3.0.

BellSoft Liberica Buildpack: 2.7.3

Error when building using Java 18 in 9.3.0

What happened?

Unable to build image using spring-boot/maven using JDK 18, after update to 9.3.0 buildpack.

  • What were you attempting to do? Build via spring boot

  • What did you expect to happen? A build using Java 18 to success

  • What was the actual behavior? Please provide log output, if possible.

[INFO]     [creator]     Paketo CA Certificates Buildpack 3.1.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/ca-certificates
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[INFO]     [creator]     
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 9.3.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_TYPE                 JRE             the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              18.*            the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           false           enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000            configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false           configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                          write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true            enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary         configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false           enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false           enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000            configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0               the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes  the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250             the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                           the JVM launch flags
[INFO]     [creator]       BellSoft Liberica JRE 18.0.0: Contributing to layer
[INFO]     [creator]         Downloading from https://github.com/bell-sw/Liberica/releases/download/18+37/bellsoft-jre18+37-linux-amd64.tar.gz
[INFO]     [creator]         Verifying checksum
[INFO]     [creator]         Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
[INFO]     [creator]     unable to invoke layer creator
[INFO]     [creator]     unable to load certificates
[INFO]     [creator]     unable to read keystore
[INFO]     [creator]     unable to decode keystore
[INFO]     [creator]      got invalid magic
[INFO]     [creator]     ERROR: failed to build: exit status 1

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Using spring-boot-maven-plugin 2.6.6.

  • What buildpacks are you using? default for spring-boot-maven-plugin

  • What builder are you using? default

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

cpu cgroup limit is not respected for ActiveProcessorCount

What happened?

I noticed, when I set limits for CPU usage and memory, the memory limits are propagated to the jvm via launch flags. However the
cpu cores are not propagated. It is always the value of the whole available cpu cores used. For instance we're running a server with 20 cores and I gave my spring boot app 2000m cpu as a limit, which according to Kubernetes is equivalent to two dedicated logical cores. When running the application I see as one of the first lines: Setting Active Processor Count to 20.
The interesting part is now, the JVM and my Spring app now take a very long time to start. Something like 23s+. When overriding the active core count via JAVA_TOOL_OPTIONS=-XX:ActiveProcessorCount=2 my startup time decreases quite dramatically down to 5s.
I tried it with different values for ActiveProcessorCount and limits. It always improved start time by a considerable amount. Even with just a single core, it went down from 53s+ to 33s.
I'm using k3s+v1.21.8

Am I missing something here?

  • What did you expect to happen?
    I would expect the buildpack to respect cgroup cpu limits and set the ActiveProcessorCount accordingly.

  • What was the actual behavior? Please provide log output, if possible.
    see above.

Build Configuration

default config, no changes to settings.

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.
    pack v0.23.0+git-7828226

  • What buildpacks are you using? Please include versions.
    paketo-buildpacks/java:
    paketo-buildpacks/ca-certificates 3.0.2
    paketo-buildpacks/bellsoft-liberica 9.0.3
    paketo-buildpacks/syft 1.6.0
    paketo-buildpacks/gradle 6.1.0
    paketo-buildpacks/executable-jar 6.0.2
    paketo-buildpacks/apache-tomcat 7.0.4
    paketo-buildpacks/dist-zip 5.0.2
    paketo-buildpacks/spring-boot 5.3.1

  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?
    latest paketobuildpacks/builder:tiny

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

No builldpack.toml found in bellsoft-liberica 10.5.2

Since this morning an error appeared while building with springboot

 > Pulling buildpack image 'gcr.io/paketo-buildpacks/bellsoft-liberica:latest' ..................................................
 > Pulled buildpack image 'gcr.io/paketo-buildpacks/bellsoft-liberica@sha256:faaca3559a0b90d3cba157e477943a2e3aaddafe08ee6e927ee5b3e17ce94d95'
 > Pulling buildpack image 'gcr.io/paketo-buildpacks/syft:latest' ..................................................
 > Pulled buildpack image 'gcr.io/paketo-buildpacks/syft@sha256:4331405e0af30ead57f6dad04185bb980464ae9ae26e2e9fb8c6612cc9a7691a'
 > Pulling buildpack image 'gcr.io/paketo-buildpacks/executable-jar:latest' ..................................................
 > Pulled buildpack image 'gcr.io/paketo-buildpacks/executable-jar@sha256:c180db9b3b287cf7217d6f17553bff5d33fc8dab80f0c9e069499028204af56e'
 > Pulling buildpack image 'gcr.io/paketo-buildpacks/dist-zip:latest' ..................................................
 > Pulled buildpack image 'gcr.io/paketo-buildpacks/dist-zip@sha256:21c6e36aa6c165fe03183fb39460d100dfc33281132a8fdd820e05c825c22fdd'
 > Pulling buildpack image 'gcr.io/paketo-buildpacks/new-relic:latest' ..................................................
 > Pulled buildpack image 'gcr.io/paketo-buildpacks/new-relic@sha256:cb598d744ed8efed765f5423c4ebfb72b8509d29092b5dca781748eff6f6cb0c'
 > Pulling buildpack image 'gcr.io/paketo-buildpacks/spring-boot:latest' ..................................................
 > Pulled buildpack image 'gcr.io/paketo-buildpacks/spring-boot@sha256:060cc20216ed34da63d6c7fcd37ceb551bbe0a3ee23e82ef5a90f97c8f554fe3'
 > Executing lifecycle version v0.18.4
 > Using build cache volume 'pack-cache-52e3ad29f678.build'

 > Running creator
    [creator]     ===> ANALYZING
    [creator]     Restoring data for SBOM from previous image
    [creator]     ===> DETECTING
    [creator]     ERROR: failed to initialize detector: open /cnb/buildpacks/paketo-buildpacks_bellsoft-liberica/10.5.2/buildpack.toml: no such file or directory

Maybe linked to paketo-buildpacks/java#1308

Support JDK 16

What happened?

  • What were you attempting to do?
    I updated the Java version to 16 and want to use maven 3.6.3 with OpenJDK 16 to build the image by
mvn spring-boot:build-image
  • What did you expect to happen?
    The expected behaviour is an image being built.

  • What was the actual behavior? Please provide log output, if possible.
    The goal failed with the error

Paketo BellSoft Liberica Buildpack 7.0.1
Step #1 - "build image": [INFO]     [creator]       unable to find dependency
Step #1 - "build image": [INFO]     [creator]       no valid dependencies for jdk, 16.*, and io.buildpacks.stacks.bionic in [(jdk, 8.0.282, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 8.0.282, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 11.0.10, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 11.0.10, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 15.0.2, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 15.0.2, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jvmkill, 1.16.0, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3])]

Build Configuration

I use Cloud Build with following configuration:

steps:
  - id: test
    name: maven:3.6.3-openjdk-16-slim
    entrypoint: mvn
    args:
      - verify
  - id: build image
    name: maven:3.6.3-openjdk-16-slim
    entrypoint: mvn
    args:
      - spring-boot:build-image

Similar issue was reported and solved for JDK 15: #14

Support JDK 15

JDK 15 doesn't seem to be supported yet. If I run bootBuildImage task from Spring Boot Gradle plugin with sourceCompatibility set to be 15, the following error occurs:

    [creator]     Paketo BellSoft Liberica Buildpack 3.2.0
    [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
    [creator]       Build Configuration:
    [creator]         $BP_JVM_VERSION              15.*            the Java version
    [creator]       Launch Configuration:
    [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]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
    [creator]     
    [creator]     Paketo BellSoft Liberica Buildpack 3.2.0
    [creator]       unable to find dependency
    [creator]       no valid dependencies for jdk, 15.*, and io.buildpacks.stacks.bionic in [(jre, 8.0.265, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 11.0.8, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 14.0.2, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 8.0.265, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 11.0.8, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 14.0.2, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jvmkill, 1.16.0, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3])]
    [creator]     ERROR: failed to build: exit status 1

> Task :bootBuildImage FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootBuildImage'.
> Builder lifecycle 'creator' failed with status code 145

Support JDK 17

What happened?

  • What were you attempting to do?

Trying to build an image using spring-boot/gradle under JDK 17

  • What did you expect to happen?

The expected behaviour is an image being built.

  • What was the actual behavior? Please provide log output, if possible.
> Task :bootBuildImage
Building image 'foo.bar/abc/qwerty:latest'
 > Pulling builder image 'docker.io/paketobuildpacks/builder:base' ..................................................
 > Pulled builder image 'paketobuildpacks/builder@sha256:624fcec632bf46a3cd72d95f760070455714c8685becb901a2f5ee7b6d856266'
 > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' ..................................................
 > Pulled run image 'paketobuildpacks/run@sha256:64e37b972ee65672ada65f2e49d2be0d0d47b87d868201965794b6c89fb6cd44'
 > Executing lifecycle version v0.11.4
 > Using build cache volume 'pack-cache-5e6a6dcf80bc.build'

 > Running creator
    [creator]     ===> DETECTING
    [creator]     5 of 18 buildpacks participating
    [creator]     paketo-buildpacks/ca-certificates   2.4.1
    [creator]     paketo-buildpacks/bellsoft-liberica 8.5.0
    [creator]     paketo-buildpacks/executable-jar    5.2.1
    [creator]     paketo-buildpacks/dist-zip          4.2.1
    [creator]     paketo-buildpacks/spring-boot       4.6.0
    [creator]     ===> ANALYZING
    [creator]     Previous image with name "foo.bar/abc/qwerty:latest" not found
    [creator]     ===> RESTORING
    [creator]     ===> BUILDING
    [creator]     
    [creator]     Paketo CA Certificates Buildpack 2.4.1
    [creator]       https://github.com/paketo-buildpacks/ca-certificates
    [creator]       Launch Helper: Contributing to layer
    [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
    [creator]     
    [creator]     Paketo BellSoft Liberica Buildpack 8.5.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              17.*            the Java version
    [creator]       Launch Configuration:
    [creator]         $BPL_HEAP_DUMP_PATH                          write heap dumps on error to this path
    [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]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
    [creator]     
    [creator]     Paketo BellSoft Liberica Buildpack 8.5.0
    [creator]       unable to find dependency
    [creator]       no valid dependencies for jdk, 17.*, and io.buildpacks.stacks.bionic in [(jdk, 8.0.302, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 8.0.302, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 11.0.12, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 11.0.12, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (native-image-svm, 11.0.12, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 16.0.2, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 16.0.2, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *])]
    [creator]     ERROR: failed to build: exit status 1

> Task :bootBuildImage FAILED

Build Configuration

❯ java --version
openjdk 17 2021-09-14
OpenJDK Runtime Environment (build 17+35-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17+35-Ubuntu-120.04, mixed mode, sharing)
  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.

  • What buildpacks are you using? Please include versions.

  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?

  • Can you provide a sample app or relevant configuration (buildpack.yml,
    nginx.conf, etc.)?

Spring boot gradle plugin: id("org.springframework.boot") version "2.5.4"

gradlew clean build bootBuildImage

Similar issue was reported and solved for JDK 16: #86

no valid dependencies for jdk, 14.* 😭

Hello,
thanks for providing the 15.* (see #14)! But at least @JeremyTwiggs and I now miss the 14.* :( Can we please get it back, for a few weeks maybe? :D

[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 5.2.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_VERSION              14.*            the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0               the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes  the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250             the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                           the JVM launch flags
[INFO]     [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO]     [creator]
[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 5.2.0
[INFO]     [creator]       unable to find dependency
[INFO]     [creator]       no valid dependencies for jdk, 14.*, and io.buildpacks.stacks.bionic in [(jdk, 8.0.275, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 8.0.275, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 11.0.9, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 11.0.9, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jdk, 15.0.1, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jre, 15.0.1, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3]) (jvmkill, 1.16.0, [io.buildpacks.stacks.bionic org.cloudfoundry.stacks.cflinuxfs3])]
[INFO]     [creator]     ERROR: failed to build: exit status 1

Thanks!!

Add Support for CRaC enabled JDK Distributions

Description of Enhancement

The BP_JVM_TYPE variable only lets us choose between "JDK" and "JRE" at the moment.
It would be nice to have a new variable or an additional value available for choosing a CRaC enabled JDK/JRE distribution.
The buildpack should then download and use the CRaC enabled distribution instead of the standard version.

Possible Solution

Add a new boolean variable "BP_CRAC_ENABLED".
Or add allowed values for existing BP_JVM_TYPE variable. Something like "JDK-CRAC" or "JRE-CRAC".

Motivation

We could keep using the existing buildpack whilst migrating to CRaC for snappy container start-ups.

Support JDK 22

[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-base:latest' 100%
[INFO]  > Pulled builder image 'docker.io/paketobuildpacks/builder-jammy-base@sha256:a913462b288209172cb7626c2ded55843002a7aa1a6bc87e9af52be1ab5511fc'
[INFO]  > Pulling run image 'docker.io/paketobuildpacks/run-jammy-base:latest' 100%
[INFO]  > Pulled run image 'docker.io/paketobuildpacks/run-jammy-base@sha256:8431203470391fc58454b71bdb917f53c20f403892fbb447f4ea5265a8d7cf49'
[INFO]  > Executing lifecycle version v0.19.0
[INFO]  > Using build cache volume 'pack-cache-d59660a7b02b.build'
[INFO] 
[INFO]  > Running creator
[INFO]     [creator]     ===> ANALYZING
[INFO]     [creator]     Restoring data for SBOM from previous image
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     7 of 26 buildpacks participating
[INFO]     [creator]     paketo-buildpacks/ca-certificates       3.6.8
[INFO]     [creator]     paketo-buildpacks/bellsoft-liberica     10.5.3
[INFO]     [creator]     paketo-buildpacks/syft                  1.45.0
[INFO]     [creator]     paketo-buildpacks/executable-jar        6.8.4
[INFO]     [creator]     paketo-buildpacks/dist-zip              5.6.9
[INFO]     [creator]     paketo-buildpacks/spring-boot           5.27.10
[INFO]     [creator]     paketo-buildpacks/environment-variables 4.5.7
[INFO]     [creator]     ===> RESTORING
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jre" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/bellsoft-liberica:helper" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/bellsoft-liberica:java-security-properties" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/spring-boot:web-application-type" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/environment-variables:environment-variables" from app image
[INFO]     [creator]     Restoring data for "paketo-buildpacks/syft:syft" from cache
[INFO]     [creator]     Restoring data for SBOM from cache
[INFO]     [creator]     ===> BUILDING
[INFO]     [creator]     
[INFO]     [creator]     Paketo Buildpack for CA Certificates 3.6.8
[INFO]     [creator]       https://github.com/paketo-buildpacks/ca-certificates
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[INFO]     [creator]     
[INFO]     [creator]     Paketo Buildpack for BellSoft Liberica 10.5.3
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
[INFO]     [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              22                                                           the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           false                                                        enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        false                                                        enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                                                             configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false                                                        enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false                                                        enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000                                                         configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0                                                            the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes                                               the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250                                                          the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags
[INFO]     [creator]         Using Java version 22 from BP_JVM_VERSION
[INFO]     [creator]       No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO]     [creator]        : Contributing to layer
[INFO]     [creator]       Warning: Dependency has no SHA256. Skipping cache.
[INFO]     [creator]         Downloading from 
[INFO]     [creator]     unable to invoke layer creator
[INFO]     [creator]     unable to get dependency 
[INFO]     [creator]     unable to download 
[INFO]     [creator]     unable to request 
[INFO]     [creator]     Get "": unsupported protocol scheme ""
[INFO]     [creator]     ERROR: failed to build: exit status 1

JDK 22 is available for download: https://bell-sw.com/pages/downloads/#jdk-22

Get Error when trying to build an image from a plain maven Java 21 project

I'm new to paketo but wanted to replace the old docker image building with this new way. I followed the post here: https://bell-sw.com/blog/how-to-use-buildpacks-to-build-java-containers/ but I got a similar issue reported here: #480 but it's somehow different since my project it's just a Hello World example using JDK Simple HTTP server with a shaded jar.

Expected Behavior

A packed image built with Alpaquita and Java 21.

Current Behavior

I met the following error:

===> ANALYZING
[analyzer] Restoring data for SBOM from previous image
===> DETECTING
[detector] 4 of 8 buildpacks participating
[detector] bellsoft/buildpacks/liberica     1.0.0
[detector] paketo-buildpacks/syft           1.26.0
[detector] paketo-buildpacks/executable-jar 6.6.1
[detector] paketo-buildpacks/spring-boot    5.23.0
===> RESTORING
[restorer] Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[restorer] Restoring data for "paketo-buildpacks/syft:syft" from cache
[restorer] Restoring data for SBOM from cache
===> BUILDING
[builder] 
[builder] Paketo Buildpack for BellSoft Liberica JDK and Native Image Kit 1.0.0
[builder]   https://github.com/bell-sw/buildpacks/liberica
[builder]   Build Configuration:
[builder]     $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
[builder]     $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
[builder]     $BP_JVM_TYPE                 jre                                                          the JVM type - JDK or JRE
[builder]     $BP_JVM_VERSION              21                                                           the Java version
[builder]   Launch Configuration:
[builder]     $BPL_DEBUG_ENABLED           false                                                        enables Java remote debugging support
[builder]     $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port
[builder]     $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached
[builder]     $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path
[builder]     $BPL_JAVA_NMT_ENABLED        true                                                         enables Java Native Memory Tracking (NMT)
[builder]     $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail
[builder]     $BPL_JFR_ARGS                                                                             configure custom Java Flight Recording (JFR) arguments
[builder]     $BPL_JFR_ENABLED             false                                                        enables Java Flight Recording (JFR)
[builder]     $BPL_JMX_ENABLED             false                                                        enables Java Management Extensions (JMX)
[builder]     $BPL_JMX_PORT                5000                                                         configure the JMX port
[builder]     $BPL_JVM_HEAD_ROOM           0                                                            the headroom in memory calculation
[builder]     $BPL_JVM_LOADED_CLASS_COUNT  35% of classes                                               the number of loaded classes in memory calculation
[builder]     $BPL_JVM_THREAD_COUNT        250                                                          the number of threads in memory calculation
[builder]     $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags
[builder]     Using Java version 21 from BP_JVM_VERSION
[builder]   No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[builder]    : Contributing to layer
[builder]   Warning: Dependency has no SHA256. Skipping cache.
[builder]     Downloading from 
[builder] unable to invoke layer creator
[builder] unable to get dependency 
[builder] unable to download 
[builder] unable to request 
[builder] Get "": unsupported protocol scheme ""
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

Possible Solution

Don't know 😬

Steps to Reproduce

I think the project idea is quite straightforward, but I will provide a repo if you need it.
Those are the commands I executed:

pack config default-builder bellsoft/buildpacks.builder:musl 
mvnd clean package
pack build http-server/simple -e BP_JVM_TYPE=jre -e BP_JVM_VERSION=21 --path ./target/http-server-1.0-SNAPSHOT.jar 

Did I miss something? Or the builder is not yet ready for JDK21?

A fatal error has been detected by the Java Runtime Environment

When trying to start a Spring Boot application in Kubernetes built with spring-boot-maven-plugin/build-image the JVM crashes with:
SIGSEGV (0xb) at pc=0x00007fd188ef62f7, pid=1, tid=0x00007fd18a05e700

Everything works as expected when using:
docker.io/paketobuildpacks/builder:0.1.174-base
Which seems to be using paketo-buildpacks/bellsoft-liberica:8.60

But any builder that uses newer versions than bellsoft-liberica:8.60 crashes with the following error message:

log_mes.txt

Get Error when trying to build an image from spring-boot's maven plugin in a java 21 project

When trying to build an image from spring-boot's maven plugin in a java 21 project, I get the following error:
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:base' 100%
[INFO] > Pulled builder image 'paketobuildpacks/builder@sha256:17ea21162ba8c7717d3ead3ee3836a368aced7f02f2e59658e52029bd6d149e7'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' 100%
[INFO] > Pulled run image 'paketobuildpacks/run@sha256:1af9935d8987fd52b2266d288200c9482d1dd5529860bbf5bc2d248de1cb1a38'
[INFO] > Executing lifecycle version v0.16.5
[INFO] > Using build cache volume 'pack-cache-e2aad51dd085.build'
[INFO]
[INFO] > Running creator
[INFO] [creator] ===> ANALYZING
[INFO] [creator] Restoring data for SBOM from previous image
[INFO] [creator] ===> DETECTING
[INFO] [creator] 6 of 26 buildpacks participating
[INFO] [creator] paketo-buildpacks/ca-certificates 3.6.3
[INFO] [creator] paketo-buildpacks/bellsoft-liberica 10.2.6
[INFO] [creator] paketo-buildpacks/syft 1.32.1
[INFO] [creator] paketo-buildpacks/executable-jar 6.7.4
[INFO] [creator] paketo-buildpacks/dist-zip 5.6.4
[INFO] [creator] paketo-buildpacks/spring-boot 5.26.1
[INFO] [creator] ===> RESTORING
[INFO] [creator] Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[INFO] [creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:helper" from app image
[INFO] [creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:java-security-properties" from app image
[INFO] [creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jre" from app image
[INFO] [creator] Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[INFO] [creator] Restoring metadata for "paketo-buildpacks/spring-boot:helper" from app image
[INFO] [creator] Restoring metadata for "paketo-buildpacks/spring-boot:spring-cloud-bindings" from app image
[INFO] [creator] Restoring metadata for "paketo-buildpacks/spring-boot:web-application-type" from app image
[INFO] [creator] Restoring data for "paketo-buildpacks/syft:syft" from cache
[INFO] [creator] Restoring data for SBOM from cache
[INFO] [creator] ===> BUILDING
[INFO] [creator]
[INFO] [creator] Paketo Buildpack for CA Certificates 3.6.3
[INFO] [creator] https://github.com/paketo-buildpacks/ca-certificates
[INFO] [creator] Launch Helper: Reusing cached layer
[INFO] [creator]
[INFO] [creator] Paketo Buildpack for BellSoft Liberica 10.2.6
[INFO] [creator] https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO] [creator] Build Configuration:
[INFO] [creator] $BP_JVM_JLINK_ARGS --no-man-pages --no-header-files --strip-debug --compress=1 configure custom link arguments (--output must be omitted)
[INFO] [creator] $BP_JVM_JLINK_ENABLED false enables running jlink tool to generate custom JRE
[INFO] [creator] $BP_JVM_TYPE JRE the JVM type - JDK or JRE
[INFO] [creator] $BP_JVM_VERSION 21 the Java version
[INFO] [creator] Launch Configuration:
[INFO] [creator] $BPL_DEBUG_ENABLED false enables Java remote debugging support
[INFO] [creator] $BPL_DEBUG_PORT 8000 configure the remote debugging port
[INFO] [creator] $BPL_DEBUG_SUSPEND false configure whether to suspend execution until a debugger has attached
[INFO] [creator] $BPL_HEAP_DUMP_PATH write heap dumps on error to this path
[INFO] [creator] $BPL_JAVA_NMT_ENABLED true enables Java Native Memory Tracking (NMT)
[INFO] [creator] $BPL_JAVA_NMT_LEVEL summary configure level of NMT, summary or detail
[INFO] [creator] $BPL_JFR_ARGS configure custom Java Flight Recording (JFR) arguments
[INFO] [creator] $BPL_JFR_ENABLED false enables Java Flight Recording (JFR)
[INFO] [creator] $BPL_JMX_ENABLED false enables Java Management Extensions (JMX)
[INFO] [creator] $BPL_JMX_PORT 5000 configure the JMX port
[INFO] [creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[INFO] [creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[INFO] [creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[INFO] [creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[INFO] [creator] Using Java version 21 from BP_JVM_VERSION
[INFO] [creator] No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO] [creator] : Contributing to layer
[INFO] [creator] Warning: Dependency has no SHA256. Skipping cache.
[INFO] [creator] Downloading from
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to get dependency
[INFO] [creator] unable to download
[INFO] [creator] unable to request
[INFO] [creator] Get "": unsupported protocol scheme ""
[INFO] [creator] ERROR: failed to build: exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.975 s
[INFO] Finished at: 2023-10-19T11:32:29+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.1.4:build-image (default) on project crhist-backend: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:3.1.4:build-image fa
iled: Builder lifecycle 'creator' failed with status code 51 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.1.4:build-image (default) on project crhist-backend: Execution default of goal org.springframework.bo
ot:spring-boot-maven-plugin:3.1.4:build-image failed: Builder lifecycle 'creator' failed with status code 51
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:3.1.4:build-image failed: Builder lifecycle 'creator' failed with status code 51
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.springframework.boot.buildpack.platform.build.BuilderException: Builder lifecycle 'creator' failed with status code 51
at org.springframework.boot.buildpack.platform.build.Lifecycle.run (Lifecycle.java:240)
at org.springframework.boot.buildpack.platform.build.Lifecycle.execute (Lifecycle.java:162)
at org.springframework.boot.buildpack.platform.build.Builder.executeLifecycle (Builder.java:160)
at org.springframework.boot.buildpack.platform.build.Builder.build (Builder.java:116)
at org.springframework.boot.maven.BuildImageMojo.buildImage (BuildImageMojo.java:240)
at org.springframework.boot.maven.BuildImageMojo.execute (BuildImageMojo.java:230)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.