@Test
  public void testExecute_jarContainerizationOnMissingJar() throws IOException {
    try {
      Verifier verifier = new Verifier(simpleTestProject.getProjectRoot().toString());
      verifier.setSystemProperty("_TARGET_IMAGE", "erroronmissingjar");
      verifier.setAutoclean(false);
      verifier.addCliOption("--file=pom-jar-containerization.xml");
      verifier.executeGoals(Arrays.asList("clean", "jib:dockerBuild"));
      Assert.fail();

    } catch (VerificationException ex) {
      MatcherAssert.assertThat(
          ex.getMessage(),
          CoreMatchers.containsString(
              "Obtaining project build output files failed; make sure you have packaged your "
                  + "project before trying to build the image. (Did you accidentally run \"mvn "
                  + "clean jib:build\" instead of \"mvn clean package jib:build\"?)"));
    }
  }
Builds and runs jib:buildDocker on a project at {@code projectRoot} pushing to {@code
imageReference}.
jib-maven-plugin/src/integration-test/java/com/google/cloud/tools/jib/maven/BuildDockerMojoIntegrationTest.java