@Test public void shouldCheckProvidedIfConfigured() throws Exception { CheckMojo mojo = getMojo("simple-test"); setupProvidedArtifact(mojo); mojo.includeScopes.add(Scope.provided); mojo.execute(); verify(artifactLoader).load(argThat(hasId("boobaz")), any(File.class)); }
public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("skipping plugin execution since missinglink.skip=true"); return; } final Consumer<String> log = verbose ? msg -> getLog().info(msg) : msg -> getLog().debug(msg); logDependencies(log); final Set<ConflictCategory> categoriesToInclude; try { categoriesToInclude = includeCategories.stream() .map(ConflictCategory::valueOf) .collect(Collectors.toSet()); } catch (IllegalArgumentException e) { getLog().error(e); throw new MojoExecutionException( "Invalid value(s) for 'includeCategories': " + includeCategories + ". " + "Valid choices are: " + Joiner.on(", ").join(ConflictCategory.values())); } Collection<Conflict> conflicts = loadArtifactsAndCheckConflicts(); final int initialCount = conflicts.size(); conflicts = filterConflicts(conflicts, categoriesToInclude); if (conflicts.isEmpty()) { getLog().info("No conflicts found"); } else { String warning = conflicts.size() + " conflicts found!"; if (initialCount != conflicts.size()) { warning += " (" + initialCount + " conflicts were found before applying filters)"; } getLog().warn(warning); outputConflicts(conflicts); if (failOnConflicts) { final String message = conflicts.size() + " class/method conflicts found between source " + "code in this project and the runtime dependencies from the Maven" + " project. Look above for specific descriptions of each conflict"; throw new MojoFailureException(message); } } }
CheckMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("skipping plugin execution since missinglink.skip=true"); return; } final Consumer<String> log = verbose ? msg -> getLog().info(msg) : msg -> getLog().debug(msg); logDependencies(log); final Set<ConflictCategory> categoriesToInclude; try { categoriesToInclude = includeCategories.stream() .map(ConflictCategory::valueOf) .collect(Collectors.toSet()); } catch (IllegalArgumentException e) { getLog().error(e); throw new MojoExecutionException( "Invalid value(s) for 'includeCategories': " + includeCategories + ". " + "Valid choices are: " + Joiner.on(", ").join(ConflictCategory.values())); } Collection<Conflict> conflicts = loadArtifactsAndCheckConflicts(); final int initialCount = conflicts.size(); conflicts = filterConflicts(conflicts, categoriesToInclude); if (conflicts.isEmpty()) { getLog().info("No conflicts found"); } else { String warning = conflicts.size() + " conflicts found!"; if (initialCount != conflicts.size()) { warning += " (" + initialCount + " conflicts were found before applying filters)"; } getLog().warn(warning); outputConflicts(conflicts); if (failOnConflicts) { final String message = conflicts.size() + " class/method conflicts found between source " + "code in this project and the runtime dependencies from the Maven" + " project. Look above for specific descriptions of each conflict"; throw new MojoFailureException(message); } } } }
CheckMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("skipping plugin execution since missinglink.skip=true"); return; } final Consumer<String> log = verbose ? msg -> getLog().info(msg) : msg -> getLog().debug(msg); logDependencies(log); final Set<ConflictCategory> categoriesToInclude; try { categoriesToInclude = includeCategories.stream() .map(ConflictCategory::valueOf) .collect(Collectors.toSet()); } catch (IllegalArgumentException e) { getLog().error(e); throw new MojoExecutionException( "Invalid value(s) for 'includeCategories': " + includeCategories + ". " + "Valid choices are: " + Joiner.on(", ").join(ConflictCategory.values())); } Collection<Conflict> conflicts = loadArtifactsAndCheckConflicts(); final int initialCount = conflicts.size(); conflicts = filterConflicts(conflicts, categoriesToInclude); if (conflicts.isEmpty()) { getLog().info("No conflicts found"); } else { String warning = conflicts.size() + " conflicts found!"; if (initialCount != conflicts.size()) { warning += " (" + initialCount + " conflicts were found before applying filters)"; } getLog().warn(warning); outputConflicts(conflicts); if (failOnConflicts) { final String message = conflicts.size() + " class/method conflicts found between source " + "code in this project and the runtime dependencies from the Maven" + " project. Look above for specific descriptions of each conflict"; throw new MojoFailureException(message); } } }  }
CheckMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("skipping plugin execution since missinglink.skip=true"); return; } final Consumer<String> log = verbose ? msg -> getLog().info(msg) : msg -> getLog().debug(msg); logDependencies(log); final Set<ConflictCategory> categoriesToInclude; try { categoriesToInclude = includeCategories.stream() .map(ConflictCategory::valueOf) .collect(Collectors.toSet()); } catch (IllegalArgumentException e) { getLog().error(e); throw new MojoExecutionException( "Invalid value(s) for 'includeCategories': " + includeCategories + ". " + "Valid choices are: " + Joiner.on(", ").join(ConflictCategory.values())); } Collection<Conflict> conflicts = loadArtifactsAndCheckConflicts(); final int initialCount = conflicts.size(); conflicts = filterConflicts(conflicts, categoriesToInclude); if (conflicts.isEmpty()) { getLog().info("No conflicts found"); } else { String warning = conflicts.size() + " conflicts found!"; if (initialCount != conflicts.size()) { warning += " (" + initialCount + " conflicts were found before applying filters)"; } getLog().warn(warning); outputConflicts(conflicts); if (failOnConflicts) { final String message = conflicts.size() + " class/method conflicts found between source " + "code in this project and the runtime dependencies from the Maven" + " project. Look above for specific descriptions of each conflict"; throw new MojoFailureException(message); } } }  void execute(); }
CheckMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("skipping plugin execution since missinglink.skip=true"); return; } final Consumer<String> log = verbose ? msg -> getLog().info(msg) : msg -> getLog().debug(msg); logDependencies(log); final Set<ConflictCategory> categoriesToInclude; try { categoriesToInclude = includeCategories.stream() .map(ConflictCategory::valueOf) .collect(Collectors.toSet()); } catch (IllegalArgumentException e) { getLog().error(e); throw new MojoExecutionException( "Invalid value(s) for 'includeCategories': " + includeCategories + ". " + "Valid choices are: " + Joiner.on(", ").join(ConflictCategory.values())); } Collection<Conflict> conflicts = loadArtifactsAndCheckConflicts(); final int initialCount = conflicts.size(); conflicts = filterConflicts(conflicts, categoriesToInclude); if (conflicts.isEmpty()) { getLog().info("No conflicts found"); } else { String warning = conflicts.size() + " conflicts found!"; if (initialCount != conflicts.size()) { warning += " (" + initialCount + " conflicts were found before applying filters)"; } getLog().warn(warning); outputConflicts(conflicts); if (failOnConflicts) { final String message = conflicts.size() + " class/method conflicts found between source " + "code in this project and the runtime dependencies from the Maven" + " project. Look above for specific descriptions of each conflict"; throw new MojoFailureException(message); } } }  void execute();  }