Examples of DependencyGraphNode


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

        return dep;
    }

    public void testPushPopSimple()
    {
        DependencyGraphNode node = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" );
        Dependency dep = toDependency( "junit:junit:3.8.1::jar" );
        dep.setScope( "test" );
        node.addDependencyManagement( dep );

        DependencyManagementStack stack = new DependencyManagementStack();
        stack.push( node );
        DependencyGraphNode oldnode = stack.pop();
        assertEquals( "added node to old node", node, oldnode );
    }
View Full Code Here

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

    {
        DependencyManagementStack stack = new DependencyManagementStack();
        Dependency dep;

        // top node.
        DependencyGraphNode projectNode = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" );
        dep = toDependency( "junit:junit:3.8.1::jar" );
        dep.setScope( "test" );
        projectNode.addDependencyManagement( dep );
        stack.push( projectNode );

        // direct node.
        DependencyGraphNode directNode = toNode( "org.apache.maven.archiva:depmanstack-common:1.0::jar" );
        dep = toDependency( "junit:junit:3.7::jar" );
        dep.setScope( "test" );
        directNode.addDependencyManagement( dep );
        stack.push( directNode );

        // transitive node.
        DependencyGraphNode transNode = toNode( "org.apache.maven.archiva:depmanstack-model:1.0::jar" );
        dep = toDependency( "junit:junit:3.7::jar" );
        transNode.addDependencyManagement( dep );
        stack.push( transNode );

        // Test it
        assertEquals( "popped node is trans node", transNode, stack.pop() );
        assertEquals( "popped node is direct node", directNode, stack.pop() );
View Full Code Here

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

    {
        DependencyManagementStack stack = new DependencyManagementStack();
        Dependency dep;

        // top node.
        DependencyGraphNode projectNode = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" );
        dep = toDependency( "junit:junit:3.8.1::jar" );
        dep.setScope( "test" );
        projectNode.addDependencyManagement( dep );
        stack.push( projectNode );

        // direct node.
        DependencyGraphNode directNode = toNode( "org.apache.maven.archiva:depmanstack-common:1.0::jar" );
        dep = toDependency( "junit:junit:3.7::jar" );
        dep.setScope( "test" );
        directNode.addDependencyManagement( dep );
        stack.push( directNode );

        // transitive node.
        DependencyGraphNode transNode = toNode( "org.apache.maven.archiva:depmanstack-model:1.0::jar" );
        dep = toDependency( "junit:junit:3.7.1::jar" );
        transNode.addDependencyManagement( dep );
        stack.push( transNode );

        // Test it
        DependencyGraphNode junitNode = toNode( "junit:junit:1.0::jar" );

        assertRules( "junit (lvl:trans)", stack, junitNode, "3.8.1", "test", null );
        stack.pop();
        assertRules( "junit (lvl:direct)", stack, junitNode, "3.8.1", "test", null );
        stack.pop();
View Full Code Here

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

    {
        DependencyManagementStack stack = new DependencyManagementStack();
        Dependency dep;

        // project node, A
        DependencyGraphNode nodeA = toNode( "org.apache.maven.archiva:carlos-A:1.0::jar" );
        stack.push( nodeA );

        // sub node, B
        DependencyGraphNode nodeB = toNode( "org.apache.maven.archiva:carlos-B:1.0::jar" );
        dep = toDependency( "org.apache.maven.archiva:carlos-D:2.0::jar" );
        nodeB.addDependencyManagement( dep );
        stack.push( nodeB );

        // sub node, C
        DependencyGraphNode nodeC = toNode( "org.apache.maven.archiva:carlos-C:1.0::jar" );
        stack.push( nodeC );

        // sub node, D
        // Not added to the stack, as this is the node that is having the rules applied to it.
        DependencyGraphNode nodeD = toNode( "org.apache.maven.archiva:carlos-D:1.0::jar" );

        // Test it
        assertRules( "node D (lvl:C)", stack, nodeD, "2.0", null, null );
        stack.pop();
        assertRules( "node D (lvl:B)", stack, nodeD, "2.0", null, null );
View Full Code Here

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

        // Identify deps that need to be resolved.
        it = graph.getNodes().iterator();
        while ( it.hasNext() )
        {
            DependencyGraphNode node = (DependencyGraphNode) it.next();
            String key = DependencyGraphKeys.toManagementKey( node.getArtifact() );
            // This will add this node to the specified key, not replace a previous one.
            depMap.put( key, node );
        }

        // Process those depMap entries with more than 1 value.
View Full Code Here

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

        // 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

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

        generateDepMap();
    }

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

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

            {
                // 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

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

        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

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

        // Process for excluded edges.
        String toKey = DependencyGraphKeys.toManagementKey( artifact );
        Iterator it = this.nodePath.iterator();
        while ( it.hasNext() )
        {
            DependencyGraphNode pathNode = (DependencyGraphNode) it.next();
       
            // Process dependency declared exclusions.
            if ( pathNode.getExcludes().contains( toKey ) )
            {
                edge.setDisabled( true );
                edge.setDisabledType( DependencyGraph.DISABLED_EXCLUDED );
                String whoExcluded = DependencyGraphKeys.toKey( pathNode );
                edge.setDisabledReason( "Specifically Excluded by " + whoExcluded );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.