Package org.apache.maven.project

Examples of org.apache.maven.project.ProjectBuildingException


    {
        if ( pom.exists() )
        {
            if ( pom.length() == 0 )
            {
                throw new ProjectBuildingException( "unknown", "The file " + pom.getAbsolutePath() +
                    " you specified has zero length." );
            }
        }

        return projectBuilder.build( pom, localRepository, globalProfileManager );
View Full Code Here


      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)
      {
         messages.add(new LogRecord(Level.SEVERE, e.getMessage()));
View Full Code Here

                                                                                  d.isOptional() );
                    map.put( d.getManagementKey(), artifact );
                }
                catch ( InvalidVersionSpecificationException e )
                {
                    throw new ProjectBuildingException( projectId, "Unable to parse version '" + d.getVersion()
                        + "' for dependency '" + d.getManagementKey() + "': " + e.getMessage(), e );
                }
            }
        }
        else
View Full Code Here

                    Artifact artifact = factory.createDependencyArtifact(d
                            .getGroupId(), d.getArtifactId(), versionRange, d
                            .getType(), d.getClassifier(), d.getScope());
                    map.put(d.getManagementKey(), artifact);
                } catch (InvalidVersionSpecificationException e) {
                    throw new ProjectBuildingException(projectId,
                            "Unable to parse version '" + d.getVersion()
                                    + "' for dependency '"
                                    + d.getManagementKey() + "': "
                                    + e.getMessage(), e);
                }
View Full Code Here

        return DiagnosisUtils.containsInCausality( error, ProjectBuildingException.class );
    }

    public String diagnose( Throwable error )
    {
        ProjectBuildingException pbe =
            (ProjectBuildingException) DiagnosisUtils.getFromCausality( error, ProjectBuildingException.class );

        StringBuffer message = new StringBuffer();

        message.append( "Error building POM (may not be this project's POM)." ).append( "\n\n" );

        message.append( "\nProject ID: " ).append( pbe.getProjectId() );

        if ( pbe instanceof InvalidProjectModelException )
        {
            InvalidProjectModelException ipme = (InvalidProjectModelException) pbe;

            message.append( "\nPOM Location: " ).append( ipme.getPomLocation() );

            ModelValidationResult result = ipme.getValidationResult();

            if ( result != null )
            {
                message.append( "\nValidation Messages:\n\n" ).append( ipme.getValidationResult().render( "    " ) );
            }
        }

        message.append( "\n\n" ).append( "Reason: " ).append( pbe.getMessage() );

        message.append( "\n\n" );

        return message.toString();
    }
View Full Code Here

    {
        if ( pom.exists() )
        {
            if ( pom.length() == 0 )
            {
                throw new ProjectBuildingException( "unknown", "The file " + pom.getAbsolutePath() +
                    " you specified has zero length." );
            }
        }

        return projectBuilder.build( pom, localRepository, globalProfileManager );
View Full Code Here

    {
        if ( pom.exists() )
        {
            if ( pom.length() == 0 )
            {
                throw new ProjectBuildingException( "unknown", "The file " + pom.getAbsolutePath() +
                    " you specified has zero length." );
            }
        }

        return projectBuilder.build( pom, localRepository, globalProfileManager );
View Full Code Here

                            d.getClassifier(), d.getScope() );
                    map.put( d.getManagementKey(), artifact );
                }
                catch ( InvalidVersionSpecificationException e )
                {
                    throw new ProjectBuildingException( projectId, "Unable to parse version '" + d.getVersion() +
                            "' for dependency '" + d.getManagementKey() + "': " + e.getMessage(), e );
                }
            }
        }
        else
View Full Code Here

                    Artifact artifact = factory.createDependencyArtifact(d
                            .getGroupId(), d.getArtifactId(), versionRange, d
                            .getType(), d.getClassifier(), d.getScope());
                    map.put(d.getManagementKey(), artifact);
                } catch (InvalidVersionSpecificationException e) {
                    throw new ProjectBuildingException(projectId,
                            "Unable to parse version '" + d.getVersion()
                                    + "' for dependency '"
                                    + d.getManagementKey() + "': "
                                    + e.getMessage(), e);
                }
View Full Code Here

            MavenProject project = projectBuilder.buildFromRepository( artifact, Collections.EMPTY_LIST, repository );
            return project.getModel();
        }
        catch ( InvalidArtifactRTException e )
        {
            throw new ProjectBuildingException( artifact.getId(),
                                                "Unable to build project from invalid artifact [" + artifact + "]", e );
        }
    }
View Full Code Here

TOP

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

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.