bell-sw / Liberica

Free and 100% open source Progressive Java Runtime for modern Java™ deployments supported by a leading OpenJDK contributor
https://bell-sw.com/pages/libericajdk/
GNU General Public License v2.0
299 stars 28 forks source link

Buildpacks with Java 21 #147

Open dev-ai-lab opened 9 months ago

dev-ai-lab commented 9 months ago

I use latest java and spring boot versions. My maven configuration is:

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <image>
                        <name>dockerxya/${project.artifactId}</name>
                        <env>
                            <BP_JVM_VERSION>21.0.1</BP_JVM_VERSION>
                            <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>

                        </env>
                    </image>
                </configuration>
            </plugin>

Setting BP_JVM_VERSION to 21 or 21.0.1 neither works. Error:


       $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags
[INFO]     [creator]         Using Java version 21.0.1 from BP_JVM_VERSION
[INFO]     [creator]     
[INFO]     [creator]     Paketo Buildpack for BellSoft Liberica 10.2.6
[INFO]     [creator]       unable to find dependency
[INFO]     [creator]       no valid dependencies for native-image-svm, 21.0.1, and io.buildpacks.stacks.bionic in [(jdk, 8.0.372, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jre, 8.0.372, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) (jdk, 11.0.19, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *]) 
den1ska commented 8 months ago

@dev-ai-lab You're using a bit outdated BellSoft Liberica buildpack v10.2.6 which doesn't contain Liberica JDK 21+. Please make sure you use the right version v10.4.2.

dev-ai-lab commented 8 months ago

@den1ska Could you tell me how to set the right version by correcting below configurations? This is how my current maven configuration looks like:

            <plugin>
                <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <image>
                        <name>dockerxya/${project.artifactId}</name>
                        <env>
                            <BP_JVM_VERSION>21.0.1</BP_JVM_VERSION>
                            <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
                        </env>
                                            </image>
                </configuration>
            </plugin>
den1ska commented 8 months ago

Try to add

<pullPolicy>ALWAYS</pullPolicy>

right after <image></image>.