protected void executeWithArtifacts()

in src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java [45:67]


    protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
        List<Bundle> snapshots = new ArrayList<Bundle>();
        BundleList bundleList = getInitializedBundleList();
        for (StartLevel level : bundleList.getStartLevels()) {
            for (Bundle bundle : level.getBundles()) {
                if (isSnapshot(bundle)) {
                    snapshots.add(bundle);
                }
            }
        }
        if (!snapshots.isEmpty()) {
            getLog().error("The following entries in the bundle list file are SNAPSHOTs:");
            for (Bundle bundle : snapshots) {
                getLog().error(
                        String
                                .format("     %s:%s:%s", bundle.getGroupId(), bundle.getArtifactId(), bundle
                                        .getVersion()));
            }
            if (failOnSnapshot) {
                throw new MojoFailureException("SNAPSHOTs were found in the bundle list. See log.");
            }
        }
    }