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


Java DependencyNode.getChildren方法代码示例

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


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

示例1: addDependencyArtifacts

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入方法依赖的package包/类
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,代码行数:26,代码来源:AbstractDependencyProcessingPlayMojo.java

示例2: findArtifactNode

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入方法依赖的package包/类
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,代码行数:27,代码来源:AbstractDependencyProcessingPlayMojo.java

示例3: visit

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入方法依赖的package包/类
@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,代码行数:15,代码来源:DependencyPanel.java

示例4: include

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入方法依赖的package包/类
/**
 * 判断是否需要解析该依赖
 * @param root 需要判断的依赖
 * @return 是否需要解析
 */
public static boolean include(DependencyNode root) {
    for (DependencyNode node : root.getChildren()) {
        Artifact artifact = node.getArtifact();
        if(artifact.getGroupId().equals("io.github.xausky") &&
                artifact.getArtifactId().equals("class-fusion-annotations")){
            return true;
        }
    }
    return false;
}
 
开发者ID:xausky,项目名称:class-fusion-parent,代码行数:16,代码来源:FusionDependencyFilter.java

示例5: getDependenciesToCheck

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入方法依赖的package包/类
private Set<Artifact> getDependenciesToCheck( MavenProject project, ArtifactRepository localRepository )
{
    Set<Artifact> dependencies = null;
    try
    {
        DependencyNode node = treeBuilder.buildDependencyTree( project, localRepository, null );
        
        if( isSearchTransitive() )
        {
            dependencies  = getAllDescendants( node );
        }
        else if ( node.getChildren() != null )
        {
            dependencies = new HashSet<Artifact>();
            for( DependencyNode depNode : node.getChildren() )
            {
                dependencies.add( depNode.getArtifact() );
            }
        }
    }
    catch ( DependencyTreeBuilderException e )
    {
        // otherwise we need to change the signature of this protected method
        throw new RuntimeException( e );
    }
    return dependencies;
}
 
开发者ID:mojohaus,项目名称:extra-enforcer-rules,代码行数:28,代码来源:AbstractResolveDependencies.java


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