private static List findBannedRepositories()

in enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequireNoRepositories.java [231:248]


    private static List<String> findBannedRepositories(
            List<Repository> repos, List<String> allowedRepos, boolean allowSnapshots) {
        List<String> bannedRepos = new ArrayList<>(allowedRepos.size());
        for (Repository r : repos) {
            if (!allowedRepos.contains(r.getId())) {
                if (!allowSnapshots
                        || r.getReleases() == null
                        || r.getReleases().isEnabled()) {
                    // if we are not allowing snapshots and this repo is enabled for releases
                    // it is banned.  We don't care whether it is enabled for snapshots
                    // if you define a repo and don't enable it for anything, then we have nothing
                    // to worry about
                    bannedRepos.add(r.getId());
                }
            }
        }
        return bannedRepos;
    }