Package org.apache.maven.project

Examples of org.apache.maven.project.ProjectBuildingResult


      try
      {
         ProjectBuildingRequest request = getBuildingRequest(plexus);
         request.setResolveDependencies(true);
         ProjectBuilder builder = plexus.lookup(ProjectBuilder.class);
         ProjectBuildingResult build = builder.build(pomFile, request);
         result = build.getDependencyResolutionResult().getDependencies();
      }
      finally
      {
         plexus.shutdown();
      }
View Full Code Here


      try
      {
         ProjectBuildingRequest request = getBuildingRequest(plexus);
         request.setResolveDependencies(true);
         ProjectBuilder builder = plexus.lookup(ProjectBuilder.class);
         ProjectBuildingResult build = builder.build(pomFile, request);
         result = build.getDependencyResolutionResult().getDependencies();
      }
      finally
      {
         plexus.shutdown();
      }
View Full Code Here

        ClassLoader originalCl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader( this.plexusContainer.getContainerRealm() );
            ProjectBuilder projectBuilder = lookup( ProjectBuilder.class );
            // BZ-1007894: Check if added dependencies are resolvable.
            ProjectBuildingResult result = projectBuilder.build( modelSource, getProjectBuildingRequest() );
            if (result != null && result.getDependencyResolutionResult() != null && !result.getDependencyResolutionResult().getCollectionErrors().isEmpty()) {
                // A dependency resolution error has been produced. It can contains some error. Throw the first one to the client, so the user will fix every one sequentially.
                Exception depedencyResolutionException = result.getDependencyResolutionResult().getCollectionErrors().get(0);
                if (depedencyResolutionException != null) throw new MavenEmbedderException(depedencyResolutionException.getMessage(), depedencyResolutionException);
            }
            return result.getProject();
        } catch(ComponentLookupException e) {
            throw new MavenEmbedderException(e.getMessage(), e);
        } finally {
            Thread.currentThread().setContextClassLoader( originalCl );
            try {
View Full Code Here

      BuildResultBuilder resultBuilder = BuildResultBuilder.create();
      MavenFacetImpl mvn = getFaceted().getFacet(MavenFacetImpl.class);
      resultBuilder.status(mvn.isModelValid());
      try
      {
         ProjectBuildingResult result = mvn.getProjectBuildingResult();
         if (!result.getProblems().isEmpty())
         {
            String errorMessage = new ProjectBuildingException(Collections.singletonList(result)).getMessage();
            resultBuilder.addMessage(Severity.ERROR, errorMessage);
         }
      }
View Full Code Here

      List<Dependency> result = new ArrayList<>();

      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

   private ProjectBuilder builder;

   ProjectBuildingResult getProjectBuildingResult(MavenModelResource pomResource) throws ProjectBuildingException
   {
      ProjectBuildingResult result = cache.get(pomResource);
      if (result == null)
      {
         try
         {
            ProjectBuildingRequest request = getProjectBuildingRequest();
View Full Code Here

                ProjectBuildingRequest projectBuildingRequest =
                    new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
                projectBuildingRequest.setLocalRepository( localRepository );
                projectBuildingRequest.setRemoteRepositories( remoteArtifactRepositories );

                ProjectBuildingResult result = projectBuilder.build( f, projectBuildingRequest );

                modified = updateExcludesInDeps( result.getProject(), dependencies, transitiveDeps );
            }

            project.setFile( dependencyReducedPomLocation );
        }
    }
View Full Code Here

                ProjectBuildingRequest projectBuildingRequest =
                    new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
                projectBuildingRequest.setLocalRepository( localRepository );
                projectBuildingRequest.setRemoteRepositories( remoteArtifactRepositories );

                ProjectBuildingResult result = projectBuilder.build( f, projectBuildingRequest );

                modified = updateExcludesInDeps( result.getProject(), dependencies, transitiveDeps );
            }

            project.setFile( dependencyReducedPomLocation );
        }
    }
View Full Code Here

   private ProjectBuilder builder;

   ProjectBuildingResult getProjectBuildingResult(MavenModelResource pomResource) throws ProjectBuildingException
   {
      ProjectBuildingResult result = cache.get(pomResource);
      if (result == null)
      {
         try
         {
            ProjectBuildingRequest request = getProjectBuildingRequest();
View Full Code Here

   public Iterable<LogRecord> getBuildMessages()
   {
      List<LogRecord> messages = new ArrayList<>();
      try
      {
         ProjectBuildingResult result = getProjectBuildingResult();
         if (!result.getProblems().isEmpty())
            messages.add(new LogRecord(Level.SEVERE, new ProjectBuildingException(Collections.singletonList(result))
                     .getMessage()));
      }
      catch (ProjectBuildingException e)
      {
View Full Code Here

TOP

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

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.