Package org.apache.maven.shared.dependency.graph

Examples of org.apache.maven.shared.dependency.graph.DependencyNode


    if (resolver == null) {
      throw new IllegalArgumentException("resolver", new NullPointerException("resolver"));
    }
    List<Artifact> returnValue = null;

    final DependencyNode projectNode = dependencyGraphBuilder.buildDependencyGraph(project, filter);
    assert projectNode != null;

    final CollectingDependencyNodeVisitor visitor = new CollectingDependencyNodeVisitor();
    projectNode.accept(visitor);

    final Collection<? extends DependencyNode> nodes = visitor.getNodes();
    if (nodes != null && !nodes.isEmpty()) {
      final Artifact projectArtifact = project.getArtifact();
View Full Code Here


    public boolean updateExcludesInDeps( MavenProject project, List<Dependency> dependencies,
                                         List<Dependency> transitiveDeps )
        throws DependencyGraphBuilderException
    {
        DependencyNode node = dependencyGraphBuilder.buildDependencyGraph( project, null );
        boolean modified = false;
        for ( DependencyNode n2 : node.getChildren() )
        {
            for ( DependencyNode n3 : n2.getChildren() )
            {
                //check if it really isn't in the list of original dependencies.  Maven
                //prior to 2.0.8 may grab versions from transients instead of
View Full Code Here

            includes = Collections.emptyList();
        }

        final ArtifactMatcher exclusions = new ArtifactMatcher( excludes, includes );

        DependencyNode rootNode = null;

        try
        {
            MavenProject project = (MavenProject) helper.evaluate( "${project}" );
            rootNode = createDependencyGraphBuilder().buildDependencyGraph( project, null );
View Full Code Here

        {
            writer.write( GRAPHML_FOOTER );
        }
        else
        {
            DependencyNode p = node.getParent();
            writer.print( "<edge source=\"" + generateId( p ) + "\" target=\"" + generateId( node ) + "\">" );
            if ( node.getArtifact().getScope() != null )
            {
                // add Edge label
                writer.print( "<data key=\"d1\"><y:PolyLineEdge><y:EdgeLabel>" + node.getArtifact().getScope()
View Full Code Here

                writer.println( edge.toString() );
            }
        }
        else
        {
            DependencyNode p = node.getParent();
            // using scope as edge label.
            edges.add( new EdgeAppender( p, node, node.getArtifact().getScope() ) );
        }
        return true;
    }
View Full Code Here

        project.setArtifacts( artifacts );
        project.setDependencyArtifacts( directArtifacts );

        mojo.execute();

        DependencyNode rootNode = mojo.getDependencyGraph();
        assertNodeEquals( "testGroupId:project:jar:1.0:compile", rootNode );
        assertEquals( 2, rootNode.getChildren().size() );
        assertChildNodeEquals( "testGroupId:snapshot:jar:2.0-SNAPSHOT:compile", rootNode, 0 );
        assertChildNodeEquals( "testGroupId:release:jar:1.0:compile", rootNode, 1 );
    }
View Full Code Here

    // private methods --------------------------------------------------------

    private void assertChildNodeEquals( String expectedNode, DependencyNode actualParentNode, int actualChildIndex )
    {
        DependencyNode actualNode = (DependencyNode) actualParentNode.getChildren().get( actualChildIndex );

        assertNodeEquals( expectedNode, actualNode );
    }
View Full Code Here

        reps = _tmp;
      }

      printer.printHeader(reps);

      final DependencyNode rootNode = dependencyGraphBuilder
          .buildDependencyGraph(project, null);
      Set<Artifact> missingArtifacts = checkDepNode(rootNode, reps, 0, client, printer);

      printer.printFooter(reps);
     
View Full Code Here

        {
            rootNode = newNode;
        }
        else
        {
            DependencyNode parentNode = parentNodes.peek();
            parentNode.getChildren().add( newNode );
        }

        parentNodes.push( newNode );

        return true;
View Full Code Here

     */
    private boolean isLast( DependencyNode node )
    {
        // TODO: remove node argument and calculate from visitor calls only
       
        DependencyNode parent = node.getParent();

        boolean last;

        if ( parent == null )
        {
            last = true;
        }
        else
        {
            List<DependencyNode> siblings = parent.getChildren();

            last = ( siblings.indexOf( node ) == siblings.size() - 1 );
        }

        return last;
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.dependency.graph.DependencyNode

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.