paketo-buildpacks / spring-boot

A Cloud Native Buildpack that contributes Spring Boot dependency information and slices an application into multiple layers
Apache License 2.0
170 stars 22 forks source link

Spring Boot 3.3.0 image generation failing #490

Open jerdebsp opened 3 months ago

jerdebsp commented 3 months ago

I am trying to build a native image (I am using the pom file as generated by https://start.spring.io/) however this is not successful. Basically, this is failing at the creator stage giving a fatal error.

Expected Behavior

Build a native docker image using ./mvnw spring-boot:build-image -Pnative

Current Behavior

Generation failing in the creator stage. See log here: https://gist.github.com/jerdebsp/3c239ef9e319bc3d03943efa1d0a11d6

Steps to Reproduce

POM file:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.3.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
...
    <properties>
        <java.version>22</java.version>
        <spring-cloud.version>2023.0.2</spring-cloud.version>
    </properties>
...
            <plugin>
                <groupId>org.graalvm.buildtools</groupId>
                <artifactId>native-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <image>
                        <env>
                            <BP_JVM_VERSION>${java.version}</BP_JVM_VERSION>
                        </env>
                    </image>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>

Command used: ./mvnw spring-boot:build-image -Pnative

Java Version

java 22.0.1 2024-04-16
Java(TM) SE Runtime Environment Oracle GraalVM 22.0.1+8.1 (build 22.0.1+8-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 22.0.1+8.1 (build 22.0.1+8-jvmci-b01, mixed mode, sharing)

Maven Version: Apache Maven 3.9.6

Machine: Mac M2

Motivations

Need to build a docker image for my micro service

anthonydahanne commented 3 months ago

hello! Can you please attach the logs described here:

[INFO]     [creator]     # An error report file with more information is saved as:
[INFO]     [creator]     # /layers/paketo-buildpacks_native-image/native-image/hs_err_pid320.log

THanks!

jerdebsp commented 3 months ago

Any idea where that could be? Looked everywhere for it and couldn't find it anywhere. I tried the target/ folder and i did a find in the terminal