Package org.apache.maven.project

Examples of org.apache.maven.project.ProjectBuildingException


                    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


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

        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
View Full Code Here

        throws AssemblyFormattingException, ArchiveCreationException, InvalidAssemblerConfigurationException,
        IOException
    {
        final MavenProject project = new MavenProject( new Model() );

        final ProjectBuildingException pbe = new ProjectBuildingException( "test", "Test error." );

        final MockAndControlForAddDependencySetsTask macTask =
            new MockAndControlForAddDependencySetsTask( mockManager, new MavenProject( new Model() ) );

        final String gid = "org.test";
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, request.getProjectBuilderConfiguration() );
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

      try
      {
         ProjectBuildingResult result = mvn.getProjectBuildingResult();
         if (!result.getProblems().isEmpty())
         {
            String errorMessage = new ProjectBuildingException(Collections.singletonList(result)).getMessage();
            resultBuilder.addMessage(Severity.ERROR, errorMessage);
         }
      }
      catch (ProjectBuildingException e)
      {
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

                    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, request.getProjectBuilderConfiguration() );
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.