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

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


        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

        {
            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

            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

    protected Set<Artifact> getDependenciesToCheck( MavenProject project )
    {
        Set<Artifact> dependencies = null;
        try
        {
            DependencyNode node = graphBuilder.buildDependencyGraph( project, null );
            if( searchTransitive )
            {
                dependencies  = getAllDescendants( node );
            }
            else if ( node.getChildren() != null )
            {
                dependencies = new HashSet<Artifact>();
                for( DependencyNode depNode : node.getChildren() )
                {
                    dependencies.add( depNode.getArtifact() );
                }
            }
        }
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 = actualParentNode.getChildren().get( actualChildIndex );

        assertNodeEquals( expectedNode, actualNode );
    }
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

    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

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.