Package org.apache.maven.model

Examples of org.apache.maven.model.Site


        }
        catch ( Exception e )
        {
            throw new RuntimeException( e );
        }
        Site site = new Site();
        site.setId( "localhost" );
        distributionManagement.setSite( site );
    }
View Full Code Here


        if ( distributionManagement == null )
        {
            throw new MojoExecutionException( "Missing distribution management in project " + name );
        }

        final Site site = distributionManagement.getSite();

        if ( site == null )
        {
            throw new MojoExecutionException(
                "Missing site information in the distribution management of the project " + name );
        }

        if ( site.getUrl() == null || site.getId() == null )
        {
            throw new MojoExecutionException( "Missing site data: specify url and id for project " + name );
        }

        return site;
View Full Code Here

     * @throws MojoExecutionException if no site info is found in the tree.
     */
    protected Site getRootSite( MavenProject project )
        throws MojoExecutionException
    {
        Site site = getSite( project );

        MavenProject parent = project;

        while ( parent.getParent() != null )
        {
View Full Code Here

      }

      return hierarchy;
    }

    Site site = project.getDistributionManagement().getSite();
    if (site == null) {
      if (!ignoreMissingSiteUrl) {
        throw new MojoFailureException(
            "Missing site information in the distribution management element in the project: '"
                + project.getName() + "'.");
      }

      return null;
    }

    if (StringUtils.isEmpty(site.getUrl())) {
      if (!ignoreMissingSiteUrl) {
        throw new MojoFailureException(
            "The URL in the site is missing in the project descriptor.");
      }

      return null;
    }

    Repository repository = new Repository(site.getId(), site.getUrl());
    StringBuffer hierarchy = new StringBuffer(1024);
    hierarchy.append(repository.getHost());
    if (!StringUtils.isEmpty(repository.getBasedir())) {
      if (!repository.getBasedir().startsWith("/")) {
        hierarchy.append('/');
View Full Code Here

            if ( childDistMgmt.getSite() == null )
            {
                if ( parentDistMgmt.getSite() != null )
                {
                    Site site = new Site();

                    childDistMgmt.setSite( site );

                    site.setId( parentDistMgmt.getSite().getId() );

                    site.setName( parentDistMgmt.getSite().getName() );

                    site.setUrl( parentDistMgmt.getSite().getUrl() );

                    if ( site.getUrl() != null )
                    {
                        site.setUrl(
                            appendPath( site.getUrl(), child.getArtifactId(), childPathAdjustment, appendPaths ) );
                    }
                }
            }

            if ( childDistMgmt.getRepository() == null )
View Full Code Here

    }

    protected void mergeDistributionManagement_Site( DistributionManagement target, DistributionManagement source,
                                                     boolean sourceDominant, Map<Object, Object> context )
    {
        Site src = source.getSite();
        if ( src != null )
        {
            Site tgt = target.getSite();
            if ( tgt == null )
            {
                tgt = new Site();
                target.setSite( tgt );
            }
            mergeSite( tgt, src, sourceDominant, context );
        }
    }
View Full Code Here

    @Override
    protected void mergeDistributionManagement_Site( DistributionManagement target, DistributionManagement source,
                                                     boolean sourceDominant, Map<Object, Object> context )
    {
        Site src = source.getSite();
        if ( src != null )
        {
            Site tgt = target.getSite();
            if ( sourceDominant || tgt == null )
            {
                tgt = new Site();
                tgt.setLocation( "", src.getLocation( "" ) );
                target.setSite( tgt );
                mergeSite( tgt, src, sourceDominant, context );
            }
        }
    }
View Full Code Here

                newRepo.setUrl( repo.getUrl() );

                newDM.setRepository( newRepo );
            }

            Site site = dm.getSite();

            if ( site != null )
            {
                Site newSite = new Site();

                newSite.setId( site.getId() );
                newSite.setName( site.getName() );
                newSite.setUrl( site.getUrl() );

                newDM.setSite( newSite );
            }

            RepositoryBase sRepo = dm.getSnapshotRepository();
View Full Code Here

    }

    protected void mergeDistributionManagement_Site( DistributionManagement target, DistributionManagement source,
                                                     boolean sourceDominant, Map<Object, Object> context )
    {
        Site src = source.getSite();
        if ( src != null )
        {
            Site tgt = target.getSite();
            if ( tgt == null )
            {
                tgt = new Site();
                target.setSite( tgt );
            }
            mergeSite( tgt, src, sourceDominant, context );
        }
    }
View Full Code Here

    @Override
    protected void mergeDistributionManagement_Site( DistributionManagement target, DistributionManagement source,
                                                     boolean sourceDominant, Map<Object, Object> context )
    {
        Site src = source.getSite();
        if ( src != null )
        {
            Site tgt = target.getSite();
            if ( tgt == null )
            {
                tgt = new Site();
                target.setSite( tgt );
                mergeSite( tgt, src, sourceDominant, context );
            }
        }
    }
View Full Code Here

TOP

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

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.