private static String buildAndRunAdditionalTag(
      Path projectRoot, String imageReference, String additionalTag)
      throws VerificationException, InvalidImageReferenceException, IOException,
          InterruptedException, DigestException {
    Verifier verifier = new Verifier(projectRoot.toString());
    verifier.setSystemProperty("jib.useOnlyProjectCache", "true");
    verifier.setSystemProperty("_TARGET_IMAGE", imageReference);
    verifier.setSystemProperty("_ADDITIONAL_TAG", additionalTag);
    if (imageReference.startsWith(dockerHost)) {
      verifier.setSystemProperty("jib.allowInsecureRegistries", "true");
    }
    verifier.setAutoclean(false);
    verifier.addCliOption("-X");
    verifier.executeGoals(Arrays.asList("clean", "compile", "jib:build"));
    verifier.verifyErrorFreeLog();

    String additionalImageReference =
        ImageReference.parse(imageReference).withQualifier(additionalTag).toString();

    String output = pullAndRunBuiltImage(imageReference);
    String additionalOutput = pullAndRunBuiltImage(additionalImageReference);
    assertThat(additionalOutput).isEqualTo(output);

    String digest = readDigestFile(projectRoot.resolve("target/jib-image.digest"));
    String digestImageReference =
        ImageReference.parse(imageReference).withQualifier(digest).toString();
    String digestOutput = pullAndRunBuiltImage(digestImageReference);
    assertThat(digestOutput).isEqualTo(output);

    assertThat(getCreationTime(imageReference)).isEqualTo(Instant.EPOCH);
    assertThat(getCreationTime(additionalImageReference)).isEqualTo(Instant.EPOCH);

    return output;
  }
Builds with {@code jib:build} on a project at {@code projectRoot} pushing to {@code
imageReference} and run the image after pulling it.
jib-maven-plugin/src/integration-test/java/com/google/cloud/tools/jib/maven/BuildImageMojoIntegrationTest.java