Spring Boot Maven Plugin build-image error: Builder lifecycle 'creator' failed with status code 1

289 views Asked by At

Mac os version : 13.5.2 (22G91) processor: 1.4 GHz Quad-Core Intel Core i5

jvm version: java 17.0.2 2022-01-18 LTS springboot version : 2.4.3 maven version: Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Docker version: Client: Cloud integration: v1.0.35-desktop+001 Version: 24.0.5 API version: 1.43 Go version: go1.20.6 Git commit: ced0996 Built: Fri Jul 21 20:32:30 2023 OS/Arch: darwin/amd64 Context: desktop-linux

Server: Docker Desktop 4.22.1 (118664) Engine: Version: 24.0.5 API version: 1.43 (minimum version 1.12) Go version: go1.20.6 Git commit: a61e2b4 Built: Fri Jul 21 20:35:45 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.21 GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc: Version: 1.1.7 GitCommit: v1.1.7-0-g860f061 docker-init: Version: 0.19.0 GitCommit: de40ad0

When I run the following command under my maven project: mvn -e spring-boot:build-image, the following failure occurs:

[INFO]  > Running creator
[INFO]     [creator]     Warning: Platform requested deprecated API '0.4'
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     ERROR: failed to initialize detector: toml: line 1: files cannot contain NULL bytes; probably using UTF-16; TOML files must be UTF-8
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.387 s
[INFO] Finished at: 2023-09-09T09:43:41+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.6.4:build-image (default-cli) on project advertising: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.6.4:build-image failed: Builder lifecycle 'creator' failed with status code 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.6.4:build-image (default-cli) on project advertising: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.6.4:build-image failed: Builder lifecycle 'creator' failed with status code 1

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.6.4:build-image failed: Builder lifecycle 'creator' failed with status code 1

But when I run the same command on another Mac with an M1 chip, all things work just fine. After many tries, including version adjusting or OS upgrade, I still have no clues, so I need some help or hints!

What I want: I just want to use the buildpacks plugin normally.

0

There are 0 answers