@Test(expected = MojoFailureException.class) public void testGetScanArtifactFile_failWhenEmpty() throws Exception { newMojo().getScanArtifactFile(); }
final @NotNull File getScanArtifactFile() throws MojoFailureException { Optional<File> packageArtifact = getProject() .flatMap(p -> Optional.ofNullable(p.getArtifact())) .flatMap(a -> Optional.ofNullable(a.getFile())); if (packageArtifact.isPresent() && packageArtifact.get().exists()) { return packageArtifact.get(); } else { throw new MojoFailureException("Failed to resolve file for project artifact."); } }
ScanArtifactMojo extends AbstractITestWithPlanMojo { final @NotNull File getScanArtifactFile() throws MojoFailureException { Optional<File> packageArtifact = getProject() .flatMap(p -> Optional.ofNullable(p.getArtifact())) .flatMap(a -> Optional.ofNullable(a.getFile())); if (packageArtifact.isPresent() && packageArtifact.get().exists()) { return packageArtifact.get(); } else { throw new MojoFailureException("Failed to resolve file for project artifact."); } } }
ScanArtifactMojo extends AbstractITestWithPlanMojo { final @NotNull File getScanArtifactFile() throws MojoFailureException { Optional<File> packageArtifact = getProject() .flatMap(p -> Optional.ofNullable(p.getArtifact())) .flatMap(a -> Optional.ofNullable(a.getFile())); if (packageArtifact.isPresent() && packageArtifact.get().exists()) { return packageArtifact.get(); } else { throw new MojoFailureException("Failed to resolve file for project artifact."); } }  }
ScanArtifactMojo extends AbstractITestWithPlanMojo { final @NotNull File getScanArtifactFile() throws MojoFailureException { Optional<File> packageArtifact = getProject() .flatMap(p -> Optional.ofNullable(p.getArtifact())) .flatMap(a -> Optional.ofNullable(a.getFile())); if (packageArtifact.isPresent() && packageArtifact.get().exists()) { return packageArtifact.get(); } else { throw new MojoFailureException("Failed to resolve file for project artifact."); } }   }
ScanArtifactMojo extends AbstractITestWithPlanMojo { final @NotNull File getScanArtifactFile() throws MojoFailureException { Optional<File> packageArtifact = getProject() .flatMap(p -> Optional.ofNullable(p.getArtifact())) .flatMap(a -> Optional.ofNullable(a.getFile())); if (packageArtifact.isPresent() && packageArtifact.get().exists()) { return packageArtifact.get(); } else { throw new MojoFailureException("Failed to resolve file for project artifact."); } }   @Parameter(property = "oakpal.scan.skip")
    public boolean skip; }