spring-projects / spring-petclinic

A sample Spring-based application
Apache License 2.0
7.79k stars 23.98k forks source link

Builder is failing requiring Java17 #1723

Closed BKirov closed 2 days ago

BKirov commented 4 days ago

Hello ,l i am running this app on a K8s openshift cluster , and when builder image starts it fails with :

[INFO] Downloaded from central: https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar (658 kB at 2.7 MB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:19 min
[INFO] Finished at: 2024-11-26T15:21:40Z
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "openshift" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-java) on project spring-petclinic:
[ERROR] Rule 0: org.apache.maven.enforcer.rules.version.RequireJavaVersion failed with message:
[ERROR] This build requires at least Java 17, update your JVM, and
[ERROR]                     run the build again
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-java) on project spring-petclinic:
Rule 0: org.apache.maven.enforcer.rules.version.RequireJavaVersion failed with message:
This build requires at least Java 17, update your JVM, and
                    run the build again
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:306)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
patbaumgartner commented 3 days ago

@BKirov be aware that the baseline for Spring Boot 3.0 and Spring Framework 6.0 was change to Java 17. More Information here: - https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes

Make sure you build with a Java version >= 17.