当前位置: 首页>>代码示例>>Java>>正文


Java DependencyNode.INCLUDED属性代码示例

本文整理汇总了Java中org.apache.maven.shared.dependency.tree.DependencyNode.INCLUDED属性的典型用法代码示例。如果您正苦于以下问题:Java DependencyNode.INCLUDED属性的具体用法?Java DependencyNode.INCLUDED怎么用?Java DependencyNode.INCLUDED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.maven.shared.dependency.tree.DependencyNode的用法示例。


在下文中一共展示了DependencyNode.INCLUDED属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculateStateTipPart

@NbBundle.Messages({
    "TIP_Included=Is included",
    "TIP_Conflict=Is omitted for conflict, version used is {0}",
    "TIP_Duplicate=Is omitted for duplicate with the same version",
    "TIP_Cycle=Is omitted for cycle"
})
private static String calculateStateTipPart(DependencyNode node) {
        int s = node.getState();
        if (s == DependencyNode.INCLUDED) {
            return Bundle.TIP_Included();
        } else if (s == DependencyNode.OMITTED_FOR_CONFLICT) {
            return Bundle.TIP_Conflict(node.getRelatedArtifact().getVersion());
        } else if (s == DependencyNode.OMITTED_FOR_DUPLICATE) {
            return Bundle.TIP_Duplicate();
        } else if (s == DependencyNode.OMITTED_FOR_CYCLE) {
            return Bundle.TIP_Cycle();
        }
        throw new IllegalStateException("illegal state:" + s);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:DependencyPanel.java

示例2: addDependencyArtifacts

private void addDependencyArtifacts( Set<Artifact> collection, Set<?> classPathArtifacts, DependencyNode artifactNode )
{
    if ( artifactNode.getState() == DependencyNode.INCLUDED )
    {
        Artifact artifact = artifactNode.getArtifact();
        // don't use this artifact, because it can be unresolved
        // find corresponding artifact in "classPathArtifacts" set
        // (only if exists, if does not exist - we don't need it)
        for ( Iterator<?> iter = classPathArtifacts.iterator(); iter.hasNext(); )
        {
            Artifact a = (Artifact) iter.next();
            if ( areArtifactsEqual( artifact, a ) )
            {
                collection.add( a );
                break;
            }
        }
        List<?> childDependencyNodes = artifactNode.getChildren();
        for ( Iterator<?> iter = childDependencyNodes.iterator(); iter.hasNext(); )
        {
            DependencyNode childNode = (DependencyNode) iter.next();
            addDependencyArtifacts( collection, classPathArtifacts, childNode );
        }
    }
}
 
开发者ID:play1-maven-plugin,项目名称:play1-maven-plugin,代码行数:25,代码来源:AbstractDependencyProcessingPlayMojo.java

示例3: findArtifactNode

private DependencyNode findArtifactNode( Artifact artifact, DependencyNode findRootNode )
{
    DependencyNode result = null;
    if ( findRootNode.getState() == DependencyNode.INCLUDED )
    {
        if ( findRootNode.getArtifact().equals( artifact ) )
        {
            result = findRootNode;
        }
        else
        {
            List<?> childDependencyNodes = findRootNode.getChildren();
            for ( Iterator<?> iter = childDependencyNodes.iterator(); iter.hasNext(); )
            {
                DependencyNode childNode = (DependencyNode) iter.next();
                DependencyNode tmp = findArtifactNode( artifact, childNode );
                if ( tmp != null )
                {
                    result = tmp;
                    break;
                }
            }
        }
    }
    return result;
}
 
开发者ID:play1-maven-plugin,项目名称:play1-maven-plugin,代码行数:26,代码来源:AbstractDependencyProcessingPlayMojo.java

示例4: visit

@Override public boolean visit(DependencyNode node) {
    if (root == null) {
        root = node;
    }
    if (node.getState() == DependencyNode.INCLUDED) {
        ArtifactGraphNode grNode = scene.getGraphNodeRepresentant(node);
        if (grNode == null) {
            return false;
        }
        ArtifactWidget aw = (ArtifactWidget) scene.findWidget(grNode);
        aw.hightlightScopes(scopes);
        path.push(node);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:17,代码来源:ScopesVisitor.java

示例5: visit

@Override public boolean visit(DependencyNode node) {
    if (root == null) {
        root = node;
    }
    if (node.getState() == DependencyNode.INCLUDED) {
        ArtifactGraphNode grNode = scene.getGraphNodeRepresentant(node);
        if (grNode == null) {
            return false;
        }
        ArtifactWidget aw = (ArtifactWidget) scene.findWidget(grNode);
        aw.highlightText(searchTerm);
        path.push(node);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:17,代码来源:SearchVisitor.java

示例6: visit

@Override
public boolean visit(DependencyNode node) {
    if (root == null) {
        root = node;
        lst = new ArrayList<DependencyNode>();
    }
    for (DependencyNode ch : node.getChildren()) {
        if (ch.getState() == DependencyNode.INCLUDED &&
                scopes.contains(ch.getArtifact().getScope())) {
            lst.add(ch);
        }
    }
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:DependencyPanel.java

示例7: constructRepository

private Repository constructRepository() throws IOException {
    Repository repo = new DirRepository(classesDirectory.toPath());
    
    if (!quiet) {
        getLog().info("HuntBugs: +dir " + classesDirectory);
    }

    // collecting project dependencies including pom and transitive dependencies
    ArtifactFilter artifactFilter = new ScopeArtifactFilter("compile");
    DependencyNode rootNode;
    try {
        rootNode = treeBuilder.buildDependencyTree(project, session.getLocalRepository(), artifactFilter);
    } catch (DependencyTreeBuilderException e) {
        throw new RuntimeException(e);
    }
    CollectingDependencyNodeVisitor visitor = new CollectingDependencyNodeVisitor();
    rootNode.accept(visitor);

    // converting dependencies to type loaders
    List<DependencyNode> nodes = visitor.getNodes();
    List<ITypeLoader> deps = new ArrayList<>();
    for (DependencyNode dependencyNode : nodes) {
        int state = dependencyNode.getState();

        // checking that transitive dependency is NOT excluded
        if (state == DependencyNode.INCLUDED) {
            Artifact artifact = dependencyNode.getArtifact();
            addDependency(artifact, deps);
        }
    }
    
    if (deps.isEmpty()) {
        return repo;
    }
    
    return new CompositeRepository(
        Arrays.asList(repo, new AuxRepository(new CompositeTypeLoader(deps.toArray(new ITypeLoader[0])))));
}
 
开发者ID:amaembo,项目名称:huntbugs,代码行数:38,代码来源:HuntBugsMojo.java

示例8: visit

@Override
public boolean visit(final DependencyNode node) {
    final Artifact at = node.getArtifact();
    final int state = node.getState();
    final String key = getQualifiedName(at);
    switch (state) {
        case DependencyNode.INCLUDED:
            resolvedDependenciesByName.put(key, at);
            break;
        case DependencyNode.OMITTED_FOR_CONFLICT:
            DefaultArtifactVersion dav1 = new DefaultArtifactVersion(node.getArtifact()
                    .getVersion());
            DefaultArtifactVersion dav2 = new DefaultArtifactVersion(node.getRelatedArtifact()
                    .getVersion());
            if (isIncompatible(dav1, dav2)) {
                if (conflictDependencyArtifacts.containsKey(key)) {
                    conflictDependencyArtifacts.get(key).add(at);
                    conflictDependencyArtifacts.get(key).add(node.getRelatedArtifact());
                } else {
                    List<Artifact> ats = new ArrayList<Artifact>();
                    ats.add(at);
                    if (!key.equals(getQualifiedName(node.getRelatedArtifact()))) {
                        ats.add(node.getRelatedArtifact());
                    }
                    conflictDependencyArtifacts.put(key, ats);
                }
            }
        case DependencyNode.OMITTED_FOR_CYCLE:
        case DependencyNode.OMITTED_FOR_DUPLICATE:
        default:
            break;
    }
    return true;
}
 
开发者ID:vongosling,项目名称:dependency-mediator,代码行数:34,代码来源:DependencyResolverVisitor.java

示例9: visit

@Override public boolean visit(MavenDependencyNode node) {
        if (root == null) {
            root = node;
        }
        GraphNode<MavenDependencyNode> grNode;
        boolean primary = false;
        grNode = cache.get(node.getDependencyConflictId());
        if (node.getState() == DependencyNode.INCLUDED) {
            if (grNode == null) {
                grNode = new GraphNode(node);
                cache.put(node.getDependencyConflictId(), grNode);
            } else {
                grNode.setImpl(node);
            }
            grNode.setPrimaryLevel(path.size());
            primary = true;
        } else {
            if (grNode == null) {
                grNode = new GraphNode(node);
                String conflictId = node.getState() == DependencyNode.OMITTED_FOR_CONFLICT ? node.getRelatedDependencyConflictId() : node.getDependencyConflictId();
                cache.put(conflictId, grNode);
            }
            grNode.addDuplicateOrConflict(node);
        }

        if (!path.empty()) {
            GraphNodeImplementation parent = path.peek();
            GraphEdge ed = new GraphEdge(parent, node);
            ed.setPrimaryPath(primary);
            edges.add(ed);
        }

        if (node != root && grNode.getImpl() != null) {
            grNode.setManagedState(obtainManagedState(grNode.getImpl()));
        }

        path.push(node);
//        graphPath.push(grNode);

        return true;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:GraphConstructor.java

示例10: resolveExecutionClasspath

/**
 * Resolves the processing unit's dependencies classpath.
 * 
 * @param project the processing unit project
 * @param includeScopes the scopes of the dependencies to include
 * @param includeProjects whether to include project's output directories
 * @param reactorProjects the reactor projects
 * @param dependencyTreeBuilder the dependency tree builder
 * @param metadataSource the metadata source
 * @param artifactCollector the artifact collector
 * @param artifactResolver the artifact resolver
 * @param artifactFactory the artifact factory
 * @param localRepository the local repository
 * @param remoteRepositories the remote repositories
 * @return a list containing all dependency URLs.
 * @throws Exception
 */
static List resolveExecutionClasspath(MavenProject project, String[] includeScopes, 
        boolean includeProjects, List reactorProjects, DependencyTreeBuilder dependencyTreeBuilder, 
        ArtifactMetadataSource metadataSource, ArtifactCollector artifactCollector, 
        ArtifactResolver artifactResolver, ArtifactFactory artifactFactory, 
        ArtifactRepository localRepository, List remoteRepositories) throws Exception {
    
    Set scopes = new HashSet(includeScopes.length);
    Collections.addAll(scopes, includeScopes);
    
    // resolve all dependency of the specifies scope
    // scope 'test' is the widest scope available.
    ArtifactFilter artifactFilter = new ScopeArtifactFilter("test");
    DependencyNode root = dependencyTreeBuilder.buildDependencyTree(project, localRepository, artifactFactory,
                                                     metadataSource, artifactFilter,artifactCollector);
    
    // resolve all dependency files. if the dependency is a referenced project and not
    // a file in the repository add its output directory to the classpath. 
    Iterator i = root.preorderIterator();
    Set artifacts = new HashSet();
    while (i.hasNext()) {
        DependencyNode node = (DependencyNode)i.next();
        // the dependency may not be included due to duplication
        // dependency cycles and version conflict.
        // don't include those in the classpath.
        if (node.getState() != DependencyNode.INCLUDED) {
            PluginLog.getLog().debug("Not including dependency: " + node);
            continue;
        }
        Artifact artifact = node.getArtifact();
        if (artifact.getFile() == null) {
            try {
                // if file is not found an exception is thrown
                artifactResolver.resolve(artifact, remoteRepositories, localRepository);
            }
            catch (Exception e) {
                if (includeProjects) {
                    // try to see if the dependency is a referenced project
                    Iterator projectsIterator = reactorProjects.iterator();
                    while (projectsIterator.hasNext()) {
                        MavenProject proj = (MavenProject)projectsIterator.next();
                        if (proj.getArtifactId().equals(artifact.getArtifactId())) {
                            artifact.setFile(new File(proj.getBuild().getOutputDirectory()));
                            break;
                        }
                    }
                }
            }
        }
        if (!scopes.contains(artifact.getScope())) {
            if (artifact.getScope() != null) {
                continue;
            }
            // if it's not the same project don't add 
            if (!includeProjects || !project.getArtifactId().equals(artifact.getArtifactId())) {
                continue;
            }
        }
        artifacts.add(artifact);
    }
    
    return getArtifactURLs(artifacts);
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:79,代码来源:Utils.java

示例11: endVisit

@Override public boolean endVisit(DependencyNode node) {
    if (node.getState() == DependencyNode.INCLUDED) {
        path.pop();
    }
    return true;
}
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:6,代码来源:ScopesVisitor.java

示例12: visit

@Override public boolean visit(DependencyNode node) {
        if (root == null) {
            root = node;
        }
        ArtifactGraphNode grNode;
        boolean primary = false;
        grNode = cache.get(node.getArtifact().getDependencyConflictId());
        if (node.getState() == DependencyNode.INCLUDED) {
            if (grNode == null) {
                grNode = new ArtifactGraphNode(node);
                cache.put(node.getArtifact().getDependencyConflictId(), grNode);
            } else {
                grNode.setArtifact(node);
            }
            grNode.setPrimaryLevel(path.size());
            primary = true;
        } else {
            if (grNode == null) {
                grNode = new ArtifactGraphNode(node);
                Artifact a = node.getState() == DependencyNode.OMITTED_FOR_CONFLICT ? node.getRelatedArtifact() : node.getArtifact();
                cache.put(a.getDependencyConflictId(), grNode);
            }
            grNode.addDuplicateOrConflict(node);
        }

        if (!path.empty()) {
            DependencyNode parent = path.peek();
            ArtifactGraphEdge ed = new ArtifactGraphEdge(parent, node);
            ed.setLevel(path.size() - 1);
            ed.setPrimaryPath(primary);
            edges.add(ed);
        }

        if (node != root && grNode.getArtifact() != null) {
            grNode.setManagedState(
                    obtainManagedState(grNode.getArtifact().getArtifact(), scene));
        }

        path.push(node);
//        graphPath.push(grNode);

        return true;
    }
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:43,代码来源:GraphConstructor.java


注:本文中的org.apache.maven.shared.dependency.tree.DependencyNode.INCLUDED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。