Package org.apache.maven.project

Examples of org.apache.maven.project.DependencyResolutionResult


            DependencyResolutionRequest request =
                new DefaultDependencyResolutionRequest();
            request.setMavenProject( project );
            invoke( request, "setRepositorySession", RepositorySystemSession.class, session );

            DependencyResolutionResult result = resolver.resolve( request );

            org.eclipse.aether.graph.DependencyNode graph =
                (org.eclipse.aether.graph.DependencyNode) invoke( DependencyResolutionResult.class, result,
                                                                  "getDependencyGraph" );
View Full Code Here


                (ProjectBuildingRequest) invoke( project, "getProjectBuildingRequest" );

            DependencyResolutionRequest request =
                new DefaultDependencyResolutionRequest( project, projectBuildingRequest.getRepositorySession() );

            DependencyResolutionResult result = resolver.resolve( request );

            return buildDependencyNode( null, result.getDependencyGraph(), project.getArtifact(), filter );
        }
        catch ( DependencyResolutionException e )
        {
            throw new DependencyGraphBuilderException( e.getMessage(), e );
        }
View Full Code Here

      MavenFacetImpl maven = getFaceted().getFacet(MavenFacetImpl.class);
      try
      {
         ProjectBuildingResult projectBuildingResult = maven.getProjectBuildingResult();
         DependencyResolutionResult dependencyResolutionResult = projectBuildingResult.getDependencyResolutionResult();
         List<Dependency> deps = MavenDependencyAdapter.fromAetherList(dependencyResolutionResult.getDependencies());

         for (Dependency dependency : deps)
         {
            result.add(resolveProperties(dependency));
         }
View Full Code Here

        final DependencyResolutionRequest request = new DefaultDependencyResolutionRequest();
        request.setMavenProject( project );
        Invoker.invoke( request, "setRepositorySession", RepositorySystemSession.class, session );

        final DependencyResolutionResult result = resolveDependencies( request, reactorProjects );
        org.eclipse.aether.graph.DependencyNode graph =
            (org.eclipse.aether.graph.DependencyNode) Invoker.invoke( DependencyResolutionResult.class, result,
                                                                      "getDependencyGraph" );

        return buildDependencyNode( null, graph, project.getArtifact(), filter );
View Full Code Here

    private DependencyResolutionResult collectDependenciesFromReactor( DependencyResolutionException e,
                                                                       Collection<MavenProject> reactorProjects )
        throws DependencyGraphBuilderException
    {
        DependencyResolutionResult result = e.getResult();

        List<Dependency> reactorDeps = getReactorDependencies( reactorProjects, result.getUnresolvedDependencies() );
        result.getUnresolvedDependencies().removeAll( reactorDeps );
        Invoker.invoke( result.getResolvedDependencies(), "addAll", Collection.class, reactorDeps );

        if ( !result.getUnresolvedDependencies().isEmpty() )
        {
            throw new DependencyGraphBuilderException( "Could not resolve nor collect following dependencies: "
                + result.getUnresolvedDependencies(), e );
        }

        return result;
    }
View Full Code Here

            (ProjectBuildingRequest) Invoker.invoke( project, "getProjectBuildingRequest" );

        DependencyResolutionRequest request =
            new DefaultDependencyResolutionRequest( project, projectBuildingRequest.getRepositorySession() );

        DependencyResolutionResult result = resolveDependencies( request, reactorProjects );

        return buildDependencyNode( null, result.getDependencyGraph(), project.getArtifact(), filter );
    }
View Full Code Here

    private DependencyResolutionResult collectDependenciesFromReactor( DependencyResolutionException e,
                                                                       Collection<MavenProject> reactorProjects )
        throws DependencyGraphBuilderException
    {
        DependencyResolutionResult result = e.getResult();

        List<Dependency> reactorDeps = getReactorDependencies( reactorProjects, result.getUnresolvedDependencies() );

        result.getUnresolvedDependencies().removeAll( reactorDeps );
        Invoker.invoke( result.getResolvedDependencies(), "addAll", Collection.class, reactorDeps );

        if ( !result.getUnresolvedDependencies().isEmpty() )
        {
            throw new DependencyGraphBuilderException( "Could not resolve nor collect following dependencies: "
                + result.getUnresolvedDependencies(), e );
        }

        return result;
    }
View Full Code Here

   @Override
   public List<Dependency> getEffectiveDependencies()
   {
      MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
      ProjectBuildingResult projectBuildingResult = ((MavenFacetImpl) maven).getProjectBuildingResult();
      DependencyResolutionResult dependencyResolutionResult = projectBuildingResult.getDependencyResolutionResult();
      List<Dependency> deps = MavenDependencyAdapter.fromAetherList(dependencyResolutionResult.getDependencies());

      List<Dependency> result = new ArrayList<Dependency>();
      for (Dependency dependency : deps)
      {
         result.add(resolveProperties(dependency));
View Full Code Here

      for (ModelProblem problem : buildingResult.getProblems())
      {
         ShellMessages.warn(writer, "[ " + problem.getSeverity() + " ] " + problem.getMessage() + " @ "
                  + ModelProblemUtils.formatLocation(problem, problem.getModelId()));
      }
      DependencyResolutionResult resolutionResult = buildingResult.getDependencyResolutionResult();
      for (Exception collectionError : resolutionResult.getCollectionErrors())
      {
         StringBuilder message  = new StringBuilder();
         message.append(collectionError.getMessage());
         message.append('\n');
         if(collectionError.getCause() != null)
         {
            message.append("Cause : ");
            message.append(collectionError.getCause().getMessage());
         }
         ShellMessages.warn(writer, message.toString());
      }
      for (Dependency unresolvedDep : resolutionResult.getUnresolvedDependencies())
      {
         ShellMessages.warn(writer, "Failed to resolve dependency [ " + unresolvedDep + " ] , due to error(s) : "
                  + resolutionResult.getResolutionErrors(unresolvedDep));
      }
   }
View Full Code Here

   @Override
   public List<Dependency> getEffectiveDependencies()
   {
      MavenFacet maven = getOrigin().getFacet(MavenFacet.class);
      ProjectBuildingResult projectBuildingResult = ((MavenFacetImpl) maven).getProjectBuildingResult();
      DependencyResolutionResult dependencyResolutionResult = projectBuildingResult.getDependencyResolutionResult();
      List<Dependency> deps = MavenDependencyAdapter.fromAetherList(dependencyResolutionResult.getDependencies());

      List<Dependency> result = new ArrayList<Dependency>();
      for (Dependency dependency : deps)
      {
         result.add(resolveProperties(dependency));
View Full Code Here

TOP

Related Classes of org.apache.maven.project.DependencyResolutionResult

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.