0

I am trying to build docker image locally with Jib for project but am stuck at this issue. Can some one help me to find the solution?

This is the plugin i used in pom.xml

<plugin>
    <groupId>com.google.cloud.tools</groupId>
    <artifactId>jib-maven-plugin</artifactId>
    <version>2.5.2</version>
    <configuration>
        <from>
            <image>openjdk:16</image>
        </from>
        <container>
            <ports>
                <port>8080</port>
            </ports>
            <format>OCI</format>
        </container>
    </configuration>
</plugin>
John Kugelman
  • 349,597
  • 67
  • 533
  • 578

1 Answers1

0

jib-maven-plugin calls methods of com.google.common.base.Preconditions provided by Guava. It seems that for some reason, the runtime classpath for jib-maven-plugin has an old version of Guava. (This can happen, for example, if you have another plugin that pulls in an old version.)

You can force a specific version for a plugin runtime classpath. Here's an example:

        <groupId>com.google.cloud.tools</groupId>
        <artifactId>jib-maven-plugin</artifactId>
        <version>3.1.4</version>
        <dependencies>
          <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>30.1.1-jre</version>
          </dependency>
        </dependencies>
        <configuration>

(BTW, I'm using the latest Jib 3.1.4 and the corresponding Guava version.)

Chanseok Oh
  • 3,920
  • 4
  • 23
  • 63