【问题标题】:JHipster - Java build not compatible with the base image - jibJHipster - Java 构建与基本映像不兼容 - jib
【发布时间】:2022-11-02 22:52:25
【问题描述】:

我运行一个 JHispter 应用程序的 a Docker image build command

./mvnw package -Pprod verify jib:build

这会产生一个错误:

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

我找到a solution for Gradle。如何为 Maven 做同样的修复?

【问题讨论】:

    标签: jhipster jib


    【解决方案1】:

    您可以使用 pom.xml 上的属性&lt;jib-maven-plugin.image&gt;eclipse-temurin:17-jre-focal&lt;/jib-maven-plugin.image&gt; 指定使用的图像,它应该定义为

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

    在 jib-maven-plugin 构建定义中,也在 pom.xml 上。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-13
      • 2021-05-28
      • 2019-12-05
      • 2021-03-21
      • 1970-01-01
      • 1970-01-01
      • 2020-04-12
      相关资源
      最近更新 更多