Package org.sonatype.aether.graph

Examples of org.sonatype.aether.graph.DependencyNode


        MavenProject project = session.getCurrentProject();

        DependencyFilter dependencyFilter = project.getExtensionDependencyFilter();
        dependencyFilter = AndDependencyFilter.newInstance( dependencyFilter, filter );

        DependencyNode root =
            pluginDependenciesResolver.resolve( plugin, RepositoryUtils.toArtifact( pluginArtifact ), dependencyFilter,
                                                project.getRemotePluginRepositories(), session.getRepositorySession() );

        PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
        root.accept( nlg );

        List<Artifact> exposedPluginArtifacts = new ArrayList<Artifact>( nlg.getNodes().size() );
        RepositoryUtils.toArtifacts( exposedPluginArtifacts, Collections.singleton( root ),
                                     Collections.<String> emptyList(), null );
        for ( Iterator<Artifact> it = exposedPluginArtifacts.iterator(); it.hasNext(); )
View Full Code Here


            return node;
        }

        for ( DependencyNode child : node.getChildren() )
        {
            DependencyNode result = findPlexusUtils( child );
            if ( result != null )
            {
                return result;
            }
        }
View Full Code Here

    private List<Artifact> resolveExtensionArtifacts( Plugin extensionPlugin, List<RemoteRepository> repositories,
                                                      ProjectBuildingRequest request )
        throws PluginResolutionException
    {
        DependencyNode root =
            pluginDependenciesResolver.resolve( extensionPlugin, null, null, repositories,
                                                request.getRepositorySession() );

        PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
        root.accept( nlg );
        return nlg.getArtifacts( false );
    }
View Full Code Here

            {
                collect.addManagedDependency( RepositoryUtils.toDependency( dependency, stereotypes ) );
            }
        }

        DependencyNode node;
        try
        {
            node = repoSystem.collectDependencies( session, collect ).getRoot();
            result.setDependencyGraph( node );
        }
        catch ( DependencyCollectionException e )
        {
            result.setDependencyGraph( e.getResult().getRoot() );
            result.setCollectionErrors( e.getResult().getExceptions() );

            throw new DependencyResolutionException( result, "Could not resolve dependencies for project "
                + project.getId() + ": " + e.getMessage(), e );
        }

        if ( logger.isWarnEnabled() )
        {
            for ( DependencyNode child : node.getChildren() )
            {
                if ( !child.getRelocations().isEmpty() )
                {
                    logger.warn( "The artifact " + child.getRelocations().get( 0 ) + " has been relocated to "
                        + child.getDependency().getArtifact() );
                }
            }
        }

        if ( logger.isDebugEnabled() )
        {
            node.accept( new GraphLogger( project ) );
        }

        try
        {
            process( result, repoSystem.resolveDependencies( session, node, filter ) );
View Full Code Here

            CollectRequest collectRequest = new CollectRequest();
            collectRequest.setRoot( dependency );
            //collectRequest.addRepository( remoteRepos );

            DependencyNode node;
            try {
                node = repoSystem.collectDependencies( repoSession, collectRequest ).getRoot();
            } catch (DependencyCollectionException e) {
              throw new MojoExecutionException( e.getMessage(), e );
            }

            DependencyRequest dependencyRequest = new DependencyRequest( node, null );
            Set<String> included = Collections.singleton("runtime");
            dependencyRequest.setFilter(new ScopeDependencyFilter(included, Collections.EMPTY_SET));

            try {
                repoSystem.resolveDependencies( repoSession, dependencyRequest  );
            } catch (DependencyResolutionException e) {
                throw new MojoExecutionException( e.getMessage(), e );
            }

            PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
            node.accept( nlg );
            getLog().info( "" + nlg.getClassPath() );

            return nlg.getArtifacts(false);
        }
View Full Code Here

                try {
                    CollectRequest collectRequest = new CollectRequest();
                    collectRequest.setRoot(rootDependency);
                    collectRequest.setRepositories(projectRepos);

                    DependencyNode rootNode = repoSystem.collectDependencies( session, collectRequest ).getRoot();

                    DependencyRequest request = new DependencyRequest(rootNode,null);
                    DependencyResult result = repoSystem.resolveDependencies(session,request);

View Full Code Here

        CollectRequest collectRequest = new CollectRequest();
        collectRequest.setRoot(moduleNode.getDependency());
        collectRequest.setRepositories(projectRepos);
        try {
            // collect all the dependency graph for the module, and print it until we reach a dependency to a local module
            DependencyNode rootNode = repoSystem.collectDependencies( session, collectRequest ).getRoot();

            DependencyRequest request = new DependencyRequest(rootNode,null);
            DependencyResult result = repoSystem.resolveDependencies(session,request);

            // add entry to module dependencies
View Full Code Here

                try {
                    CollectRequest collectRequest = new CollectRequest();
                    collectRequest.setRoot(rootDependency);
                    collectRequest.setRepositories(projectRepos);

                    DependencyNode rootNode = repoSystem.collectDependencies( session, collectRequest ).getRoot();

                    DependencyRequest request = new DependencyRequest(rootNode,null);
                    DependencyResult result = repoSystem.resolveDependencies(session,request);

View Full Code Here

        CollectRequest collectRequest = new CollectRequest();
        collectRequest.setRoot(moduleNode.getDependency());
        collectRequest.setRepositories(projectRepos);
        try {
            // collect all the dependency graph for the module, and print it until we reach a dependency to a local module
            DependencyNode rootNode = repoSystem.collectDependencies( session, collectRequest ).getRoot();

            DependencyRequest request = new DependencyRequest(rootNode,null);
            DependencyResult result = repoSystem.resolveDependencies(session,request);

            // add entry to module dependencies
View Full Code Here

        StringBuilder buffer = new StringBuilder( 1024 );

        for ( Iterator<DependencyNode> it = nlg.getNodes().iterator(); it.hasNext(); )
        {
            DependencyNode node = it.next();
            if ( node.getDependency() != null )
            {
                Artifact artifact = node.getDependency().getArtifact();
                // skip pom artifacts
                if ( artifact.getFile() != null && !"pom".equals(artifact.getExtension()))
                {
                    buffer.append( artifact.getFile().getAbsolutePath() );
                    if ( it.hasNext() )
View Full Code Here

TOP

Related Classes of org.sonatype.aether.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.