I would like to have different image names per jib goal, but it seems like jib is not picking up the goal configuration, only uses the global one. Here is my pom snippet:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
<container>
<from>
<image>adoptopenjdk:11</image>
</from>
<mainClass>
com.example.Application
</mainClass>
<jvmFlags>
<jvmFlag>-Xms1024m</jvmFlag>
</jvmFlags>
<ports>
<port>8080</port>
</ports>
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
</container>
</configuration>
<executions>
<execution>
<id>ci-build</id>
<goals>
<goal>build</goal>
</goals>
<configuration>
<to>
<image>${env.CI_REGISTRY_IMAGE}:${revision}</image>
<tags>
<tag>latest</tag>
</tags>
</to>
</configuration>
</execution>
<execution>
<id>local-build</id>
<goals>
<goal>dockerBuild</goal>
</goals>
<configuration>
<to>
<image>recording-be:${revision}</image>
<tags>
<tag>latest</tag>
</tags>
</to>
</configuration>
</execution>
</executions>
</plugin>
the ci-build (jib:build) is used in gitlab ci to build/push the image to the gitlab container registry, while the local-build (jib:dockerBuild) is used to push locally.
However, it looks like the goal
specific configuration
is not picked up by the plugin.
How could I define different image names per goal?