private Set checkPlugins()

in maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java [187:234]


    private Set<Artifact> checkPlugins(
            ReleaseDescriptor releaseDescriptor, Map<String, Artifact> artifactMap, Set<Artifact> pluginArtifacts)
            throws ReleaseExecutionException {
        Set<Artifact> usedSnapshotPlugins = new HashSet<>();
        for (Artifact artifact : pluginArtifacts) {
            if (checkArtifact(artifact, artifactMap, releaseDescriptor)) {
                boolean addToFailures;

                if ("org.apache.maven.plugins".equals(artifact.getGroupId())
                        && "maven-release-plugin".equals(artifact.getArtifactId())) {
                    // It's a snapshot of the release plugin. Maybe just testing - ask
                    // By default, we fail as for any other plugin
                    if (releaseDescriptor.isSnapshotReleasePluginAllowed()) {
                        addToFailures = false;
                    } else if (releaseDescriptor.isInteractive()) {
                        try {
                            String result;
                            if (!releaseDescriptor.isSnapshotReleasePluginAllowed()) {
                                prompter.get()
                                        .showMessage("This project relies on a SNAPSHOT of the release plugin. "
                                                + "This may be necessary during testing.\n");
                                result = prompter.get()
                                        .prompt(
                                                "Do you want to continue with the release?",
                                                Arrays.asList("yes", "no"),
                                                "no");
                            } else {
                                result = "yes";
                            }

                            addToFailures = !result.toLowerCase(Locale.ENGLISH).startsWith("y");
                        } catch (PrompterException e) {
                            throw new ReleaseExecutionException(e.getMessage(), e);
                        }
                    } else {
                        addToFailures = true;
                    }
                } else {
                    addToFailures = true;
                }

                if (addToFailures) {
                    usedSnapshotPlugins.add(artifact);
                }
            }
        }
        return usedSnapshotPlugins;
    }