Package org.apache.maven.archiva.dependency.graph

Examples of org.apache.maven.archiva.dependency.graph.DependencyGraphNode


        graph.addEdge( edge );
    }

    private void ensureNodeExists( DependencyGraph graph, ArtifactReference artifact )
    {
        DependencyGraphNode node = graph.getNode( artifact );
        if ( node == null )
        {
            node = new DependencyGraphNode( artifact );
            graph.addNode( node );
        }
    }
View Full Code Here


            return;
        }

        // Find winning node.
        ArtifactReference winningArtifact = findWinningArtifact( this.foundNodesMap.values() );
        DependencyGraphNode winningNode = graph.getNode( winningArtifact );

        // Gather up Losing Nodes.
        Set<NodeLocation> losingNodes = new HashSet<NodeLocation>();
        Predicate losersPredicate = NotPredicate.getInstance( new NodeLocationPredicate( winningArtifact ) );
        CollectionUtils.select( this.foundNodesMap.values(), losersPredicate, losingNodes );

        // Swing losing nodes to winning node.
        for ( NodeLocation losingNodeLoc : losingNodes )
        {
            DependencyGraphNode losingNode = graph.getNode( losingNodeLoc.artifact );
            DependencyGraphUtils.collapseNodes( graph, losingNode, winningNode );
        }
    }
View Full Code Here

        // Using a reverse iterator to ensure that we read the
        // stack from last in to first in
        ReverseListIterator it = new ReverseListIterator( depmanStack );
        while ( it.hasNext() )
        {
            DependencyGraphNode node = (DependencyGraphNode) it.next();

            addDependencies( node.getDependencyManagement() );
        }
    }
View Full Code Here

        generateDepMap();
    }

    public DependencyGraphNode pop()
    {
        DependencyGraphNode node = (DependencyGraphNode) depmanStack.pop();
        generateDepMap();
        return node;
    }
View Full Code Here

            {
                // No rules for edge, skip it.
                continue;
            }

            DependencyGraphNode subnode = graph.getNode( edge.getNodeTo() );

            /* There are 3 steps to processing the DependencyManagement. */

            /* 1) Add exclusions to node ________________________________________________ */
            node.getExcludes().addAll( rules.exclusions );

            /* 2) Track version changes to node _________________________________________ */

            // This is the version as specified by the rules.
            String specifiedVersion = rules.artifact.getVersion();

            // This is the version as being tracked by the nodeVersionChanges map.
            String trackedVersion = (String) nodeVersionChanges.get( edge.getNodeTo() );

            // This is the version of the subnode.
            String nodeVersion = subnode.getArtifact().getVersion();

            // This is the actual version as determined by tracked and subnode
            String actualVersion = StringUtils.defaultString( trackedVersion, nodeVersion );

            // If the specified version changes the actual version ...
View Full Code Here

        toRef.setArtifactId( fromRef.getArtifactId() );
        toRef.setVersion( toVersion );
        toRef.setClassifier( fromRef.getClassifier() );
        toRef.setType( fromRef.getType() );

        DependencyGraphNode nodeFROM = graph.getNode( fromRef );
        DependencyGraphNode nodeTO = graph.getNode( toRef );

        if ( nodeTO == null )
        {
            // new node doesn't exist in graph (yet)
            nodeTO = new DependencyGraphNode( toRef );
            nodeTO.setResolved( false );

            graph.addNode( nodeTO );

            VersionedReference projectRef = new VersionedReference();
            projectRef.setGroupId( toRef.getGroupId() );
View Full Code Here

    private void visitEdge( DependencyGraph graph, DependencyGraphEdge e, DependencyGraphVisitor visitor )
    {
        visitor.discoverEdge( e );

        DependencyGraphNode node = graph.getNode( e.getNodeTo() );

        if ( getNodeVisitState( node ) == UNSEEN )
        {
            setNodeVisitState( node, PROCESSING );
        }
View Full Code Here

        // Next move down edges.
        for ( DependencyGraphEdge e : graph.getEdgesFrom( node ) )
        {
            if ( this.edgePredicate.evaluate( e ) )
            {
                DependencyGraphNode nodeTo = graph.getNode( e.getNodeTo() );
                Integer state = getNodeVisitState( nodeTo );
                if ( ( state == UNSEEN ) || ( state == PROCESSING ) )
                {
                    visitNode( graph, nodeTo, visitor );
                }
View Full Code Here

    {
        boolean satisfies = false;

        if ( object instanceof DependencyGraphNode )
        {
            DependencyGraphNode node = (DependencyGraphNode) object;
            satisfies = !( node.isResolved() );
        }

        return satisfies;
    }
View Full Code Here

    private void visitEdge( DependencyGraph graph, DependencyGraphEdge e, DependencyGraphVisitor visitor )
    {
        visitor.discoverEdge( e );

        DependencyGraphNode node = graph.getNode( e.getNodeTo() );

        if ( getNodeVisitState( node ) == UNSEEN )
        {
            visitNode( graph, node, visitor );
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.dependency.graph.DependencyGraphNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.