Spring Boot version: 3.0.3 and 3.0.2 Java version: 19
When trying to use custom buildpack in the Spring Boot Maven plugin like this:
<configuration>
<addResources>true</addResources>
<image>
<builder>paketobuildpacks/builder:tiny</builder>
<buildpacks>
<buildpack>gcr.io/paketo-buildpacks/amazon-corretto</buildpack>
</buildpacks>
<env>
<BP_JVM_VERSION>${java.version}</BP_JVM_VERSION>
</env>
</image>
</configuration>
I get an error -> Builder lifecycle 'creator' failed with status code 20 which is related to this:
[INFO]
[INFO] --- spring-boot-maven-plugin:3.0.3:build-image (default-cli) @ gpi-server-spring-boot-assembly ---
[INFO] Building image 'docker.io/library/gpi-server-spring-boot-assembly:0.0.1-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 100%
[INFO] > Pulled builder image 'paketobuildpacks/builder@sha256:b33706203b7f3f7fb944d7a130dc05c4aa0e96c49b2b7874f8b86ed4650905fe'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:tiny-cnb' 100%
[INFO] > Pulled run image 'paketobuildpacks/run@sha256:bb67b78deff0e5ee42251903fedcfe53c776830a32a44258383df0adf18c46ae'
[INFO] > Pulling buildpack image 'gcr.io/paketo-buildpacks/amazon-corretto:latest' 100%
[INFO] > Pulled buildpack image 'gcr.io/paketo-buildpacks/amazon-corretto@sha256:35b8222bf9b03655b297e0a893fd38acbe5677cd8242f46d98d0d76087b5bd85'
[INFO] > Executing lifecycle version v0.16.0
[INFO] > Using build cache volume 'pack-cache-1bf72e90d84a.build'
[INFO]
[INFO] > Running creator
[INFO] [creator] ===> ANALYZING
[INFO] [creator] Restoring data for SBOM from previous image
[INFO] [creator] ===> DETECTING
[INFO] [creator] ======== Results ========
[INFO] [creator] pass: paketo-buildpacks/amazon-corretto@7.9.0
[INFO] [creator] Resolving plan... (try #1)
[INFO] [creator] fail: paketo-buildpacks/amazon-corretto@7.9.0 provides unused native-image-builder
[INFO] [creator] Resolving plan... (try #2)
[INFO] [creator] fail: paketo-buildpacks/amazon-corretto@7.9.0 provides unused native-image-builder
[INFO] [creator] Resolving plan... (try #3)
[INFO] [creator] fail: paketo-buildpacks/amazon-corretto@7.9.0 provides unused jre
[INFO] [creator] Resolving plan... (try #4)
[INFO] [creator] fail: paketo-buildpacks/amazon-corretto@7.9.0 provides unused jdk
[INFO] [creator] Resolving plan... (try #5)
[INFO] [creator] fail: paketo-buildpacks/amazon-corretto@7.9.0 provides unused jre
[INFO] [creator] ERROR: No buildpack groups passed detection.
[INFO] [creator] ERROR: Please check that you are running against the correct path.
[INFO] [creator] ERROR: failed to detect: no buildpacks participating
Is this not available yet somehow?
Comment From: emedina
Same issue trying out:
<buildpack>gcr.io/paketo-buildpacks/graalvm</buildpack>
<buildpack>gcr.io/paketo-buildpacks/java-native-image</buildpack>
Comment From: wilkinsona
As described in the documentation, when one or more buildpacks are provided, only the specified buildpacks will be applied. The Amazon Corretto buildpack alone isn't sufficient to build your application's image. This is also described in the Paketo documentation on how to use an alternative JVM. Their example shows the use of both the Azul buildpack and the Java buildpack. Updating that to your needs, produces the following equivalent configuration:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<buildpacks>
<buildpack>gcr.io/paketo-buildpacks/amazon-corretto</buildpack>
<buildpack>gcr.io/paketo-buildpacks/java</buildpack>
</buildpacks>
</image>
</configuration>
</plugin>
</plugins>
</build>
Detection will then complete successfully:
[INFO] > Running creator
[INFO] [creator] ===> ANALYZING
[INFO] [creator] Restoring data for SBOM from previous image
[INFO] [creator] ===> DETECTING
[INFO] [creator] 7 of 27 buildpacks participating
[INFO] [creator] paketo-buildpacks/amazon-corretto 7.9.0
[INFO] [creator] paketo-buildpacks/ca-certificates 3.6.0
[INFO] [creator] paketo-buildpacks/bellsoft-liberica 9.11.0
[INFO] [creator] paketo-buildpacks/syft 1.25.0
[INFO] [creator] paketo-buildpacks/executable-jar 6.6.1
[INFO] [creator] paketo-buildpacks/dist-zip 5.5.1
[INFO] [creator] paketo-buildpacks/spring-boot 5.23.0
[INFO] [creator] ===> RESTORING
…