private final void initBundleList()

in src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java [224:274]


    private final void initBundleList() throws IOException, XmlPullParserException, MojoExecutionException {
        initArtifactDefinitions();
        if (BundleListUtils.isCurrentArtifact(project, defaultBundleList)) {
            initializedBundleList = readBundleList(bundleListFile);
        } else {
            initializedBundleList = new BundleList();
            if (includeDefaultBundles) {
                Artifact defBndListArtifact = getArtifact(defaultBundleList.getGroupId(),
                        defaultBundleList.getArtifactId(), defaultBundleList.getVersion(), defaultBundleList.getType(),
                        defaultBundleList.getClassifier());
                getLog().info("Using bundle list file from " + defBndListArtifact.getFile().getAbsolutePath());
                initializedBundleList = readBundleList(defBndListArtifact.getFile());
            }

            if (bundleListFile.exists()) {
                initializedBundleList.merge(readBundleList(bundleListFile));
            }
        }
        // add additional bundles
        if (additionalBundles != null) {
            for (ArtifactDefinition def : additionalBundles) {
                initializedBundleList.add(def.toBundleList());
            }
        }

        interpolateProperties(initializedBundleList, project, mavenSession);

        // check for partial bundle lists
        final Set<Artifact> dependencies = project.getDependencyArtifacts();
        for (Artifact artifact : dependencies) {
            if (PARTIAL.equals(artifact.getType())) {
                getLog().info(
                        String.format("Merging partial bundle list %s:%s:%s", artifact.getGroupId(),
                                artifact.getArtifactId(), artifact.getVersion()));
                initializedBundleList.merge(readBundleList(artifact.getFile()));
            }
        }

        // handle exclusions
        if (bundleExclusions != null) {
            for (ArtifactDefinition def : bundleExclusions) {
                initializedBundleList.remove(def.toBundleList(), false);
            }
        }

        initBundleList(initializedBundleList);

        interpolateProperties(initializedBundleList, project, mavenSession);

        rewriteBundleList(initializedBundleList);
    }