class 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.");
        }
    }

}