Package org.apache.maven.model

Examples of org.apache.maven.model.Parent


            catch ( IOException e )
            {
                throw new MojoExecutionException( "NPANDAY-1700-006: Unable to read model", e );
            }

            Parent parent = model.getParent();

            if ( parent != null && addParents )
            {
                pomArtifacts.addAll( getPomArtifactsFor( parent.getGroupId(), parent.getArtifactId(),
                                                         parent.getVersion(), layout, true ) );
            }
        }

        return pomArtifacts;
    }
View Full Code Here


    private static final String ILLEGAL_REPO_ID_CHARS = ILLEGAL_FS_CHARS;

    public void validateRawModel( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
    {
        Parent parent = model.getParent();
        if ( parent != null )
        {
            validateStringNotEmpty( "parent.groupId", problems, Severity.FATAL, Version.BASE, parent.getGroupId(),
                                    parent );

            validateStringNotEmpty( "parent.artifactId", problems, Severity.FATAL, Version.BASE,
                                    parent.getArtifactId(), parent );

            validateStringNotEmpty( "parent.version", problems, Severity.FATAL, Version.BASE, parent.getVersion(),
                                    parent );

            if ( equals( parent.getGroupId(), model.getGroupId() )
                && equals( parent.getArtifactId(), model.getArtifactId() ) )
            {
                addViolation( problems, Severity.FATAL, Version.BASE, "parent.artifactId", null, "must be changed"
                    + ", the parent element cannot have the same groupId:artifactId as the project.", parent );
            }
        }
View Full Code Here

        assertEquals( "..", adjustment );
    }

    public void testIdentityProtoInheritance()
    {
        Parent parent = new Parent();

        parent.setGroupId( "test-group" );
        parent.setVersion( "1000" );
        parent.setArtifactId( "test-artifact" );

        Model model = new Model();

        model.setParent( parent );
        model.setArtifactId( "real-artifact" );
View Full Code Here

                       activeProfilesClone );
    }

    public void testInvalidParent() throws Exception
    {
        Parent parent = new Parent();
        parent.setGroupId( "test-group" );
        parent.setArtifactId( "parent-artifact" );
        parent.setVersion( "1.0" );
        Model model = new Model();
        model.setParent( parent );
        model.setArtifactId( "child-artifact" );
        final AtomicInteger logged = new AtomicInteger();
        class L extends LoggerStub
View Full Code Here

     *
     * @param model The POM to extract missing artifact coordinates from, must not be <code>null</code>.
     */
    private void processModel( Model model )
    {
        Parent parent = model.getParent();

        if ( this.groupId == null )
        {
            this.groupId = model.getGroupId();
            if ( this.groupId == null && parent != null )
            {
                this.groupId = parent.getGroupId();
            }
        }
        if ( this.artifactId == null )
        {
            this.artifactId = model.getArtifactId();
        }
        if ( this.version == null )
        {
            this.version = model.getVersion();
            if ( this.version == null && parent != null )
            {
                this.version = parent.getVersion();
            }
        }
        if ( this.packaging == null )
        {
            this.packaging = model.getPackaging();
View Full Code Here

     *
     * @param model The POM to extract missing artifact coordinates from, must not be <code>null</code>.
     */
    private void processModel( Model model )
    {
        Parent parent = model.getParent();

        if ( this.groupId == null )
        {
            this.groupId = model.getGroupId();
            if ( this.groupId == null && parent != null )
            {
                this.groupId = parent.getGroupId();
            }
        }
        if ( this.artifactId == null )
        {
            this.artifactId = model.getArtifactId();
        }
        if ( this.version == null )
        {
            this.version = model.getVersion();
            if ( this.version == null && parent != null )
            {
                this.version = parent.getVersion();
            }
        }
        if ( this.packaging == null )
        {
            this.packaging = model.getPackaging();
View Full Code Here

                pomGroupId = model.getGroupId();
                pomArtifactId = model.getArtifactId();
                pomVersion = model.getVersion();

                Parent parent = model.getParent();
                if ( parent != null )
                {
                    pom = new File( pom.getParentFile(), parent.getRelativePath() );

                    if ( pomGroupId == null )
                    {
                        pomGroupId = parent.getGroupId();
                    }

                    if ( pomVersion == null )
                    {
                        pomVersion = parent.getVersion();
                    }
                }
                else
                {
                    pom = null;
View Full Code Here

                pomGroupId = model.getGroupId();
                pomArtifactId = model.getArtifactId();
                pomVersion = model.getVersion();

                Parent parent = model.getParent();
                if ( parent != null )
                {
                    pom = new File( pom.getParentFile(), parent.getRelativePath() );

                    if ( pomGroupId == null )
                    {
                        pomGroupId = parent.getGroupId();
                    }

                    if ( pomVersion == null )
                    {
                        pomVersion = parent.getVersion();
                    }
                }
                else
                {
                    pom = null;
View Full Code Here

      MavenFacet mvn = getFaceted().getFacet(MavenFacet.class);
      Model pom = mvn.getPOM();
      String version = pom.getVersion();
      if (version == null)
      {
         Parent parent = pom.getParent();
         if (parent != null)
         {
            version = parent.getVersion();
         }
      }
      return version;
   }
View Full Code Here

      String groupId = pom.getGroupId();

      // If groupId is null, try to grab the parent's groupId
      if (groupId == null)
      {
         Parent parent = pom.getParent();
         if (parent != null)
         {
            groupId = parent.getGroupId();
         }
      }
      return groupId;
   }
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Parent

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.