public void execute()

in src/main/java/org/apache/sling/feature/analyser/task/impl/CheckContentPackageForInstallables.java [43:72]


    public void execute(final AnalyserTaskContext ctx) throws Exception {
        final boolean checkPcks =
                Boolean.parseBoolean(ctx.getConfiguration().getOrDefault(CFG_CHECK_PACKAGES, "false"));

        for (final ContentPackageDescriptor cp :
                ctx.getFeatureDescriptor().getDescriptors(ContentPackageDescriptor.class)) {
            if (cp.getArtifactFile() == null) {
                ctx.reportArtifactError(
                        cp.getArtifact().getId(),
                        "Content package " + cp.getName() + " is not resolved and can not be checked.");
                continue;
            }
            if (checkPcks && cp.isEmbeddedInContentPackage()) {
                ctx.reportArtifactError(
                        cp.getParentContentPackage().getArtifact().getId(),
                        "Content package "
                                + cp.getParentContentPackage().getArtifact().getId() + " embedds content package "
                                + cp.getName());
            }
            if (!cp.hasEmbeddedArtifacts() || cp.isEmbeddedInContentPackage()) {
                continue;
            }

            ctx.reportArtifactError(
                    cp.getArtifact().getId(),
                    "Content package " + cp.getName() + " contains "
                            + String.valueOf(cp.getBundles().size()) + " bundles and "
                            + String.valueOf(cp.getConfigurations().size()) + " configurations.");
        }
    }