0

I run a Docker image build command of a JHispter app

./mvnw package -Pprod verify jib:build

that yields an error:

Your project is using Java 17 but the base image is for Java 11, perhaps you should configure a Java 17-compatible base image using the '<from><image>' parameter, or set maven-compiler-plugin's '<target>' or '<release>' version to 11 or below in your build configuration

I find a solution for Gradle. How to do the same fix for Maven?

vic
  • 2,548
  • 9
  • 44
  • 74

1 Answers1

0

You can specify the image used using the property <jib-maven-plugin.image>eclipse-temurin:17-jre-focal</jib-maven-plugin.image> on the pom.xml, it should be defined as

<from>
  <image>${jib-maven-plugin.image}</image>
  <platforms>
    <platform>
      <architecture>${jib-maven-plugin.architecture}</architecture>
      <os>linux</os>
    </platform>
  </platforms>
</from>

In the jib-maven-plugin build definition, on the pom.xml as well.

axelroy
  • 1
  • 3