public boolean visit()

in nbm-maven-plugin/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java [100:138]


    public boolean visit(DependencyNode node) {
        if (throwable != null) {
            return false;
        }
        if (root == node) {
            return true;
        }
        try {
            Artifact artifact = node.getArtifact();
            if (!artifacts.containsKey(artifact.getDependencyConflictId())) {
                //ignore non-runtime stuff..
                return false;
            }
            // somehow the transitive artifacts in the  tree are not always resolved?
            artifact = artifacts.get(artifact.getDependencyConflictId());

            ExamineManifest depExaminator = examinerCache.get(artifact);
            if (depExaminator == null) {
                depExaminator = new ExamineManifest(log);
                depExaminator.setArtifactFile(artifact.getFile());
                depExaminator.checkFile();
                examinerCache.put(artifact, depExaminator);
            }
            if (AbstractNbmMojo.matchesLibrary(artifact, explicitLibs, depExaminator, log, useOsgiDependencies)) {
                if (depExaminator.isNetBeansModule()) {
                    log.warn("You are using a NetBeans Module as a Library (classpath extension): " + artifact.getId());
                }

                nodes.add(artifact);
                includes.add(artifact.getDependencyConflictId());
                // if a library, iterate to it's child nodes.
                return true;
            }
        } catch (MojoExecutionException mojoExecutionException) {
            throwable = mojoExecutionException;
        }
        //don't bother iterating to childs if the current node is not a library.
        return false;
    }