Package org.apache.maven.model

Examples of org.apache.maven.model.Site


            if ( distributionManagement == null )
            {
                throw new ContinuumException( "Missing distribution management information in the project." );
            }

            Site site = distributionManagement.getSite();
            if ( site == null )
            {
                throw new ContinuumException(
                    "Missing site information in the distribution management element in the project." );
            }

            url = site.getUrl();
            id = site.getId();
        }

        if ( url == null )
        {
            throw new ContinuumException( "The URL to the site is not defined." );
View Full Code Here


            localAsRemote.setUrl( localRepoDir.toURL().toExternalForm() );

            model.addRepository( localAsRemote );
            model.addPluginRepository( localAsRemote );

            Site site = new Site();

            site.setId( "integration-test.output" );
            site.setUrl( tmpUrl );

            distMgmt.setSite( site );

            model.setDistributionManagement( distMgmt );
View Full Code Here

    private DistributionManagement getDistributionManagement( org.apache.maven.model.v300.Model v3Model )
        throws Exception
    {
        DistributionManagement distributionManagement = new DistributionManagement();

        Site site = null;

        String siteAddress = v3Model.getSiteAddress();

        String siteDirectory = v3Model.getSiteDirectory();

        if ( isEmpty( siteAddress ) )
        {
            if ( !isEmpty( siteDirectory ) )
            {
                site = new Site();

                site.setId( "default" );

                site.setName( "Default Site" );

                site.setUrl( "file://" + siteDirectory );
            }
        }
        else
        {
            if ( isEmpty( siteDirectory ) )
            {
                throw new Exception( "Missing 'siteDirectory': Both siteAddress and siteDirectory must be set at the same time." );
            }

            site = new Site();

            site.setId( "default" );

            site.setName( "Default Site" );

            site.setUrl( "scp://" + siteAddress + "/" + siteDirectory );
        }

        distributionManagement.setSite( site );

        String distributionSite = v3Model.getDistributionSite();
View Full Code Here

            }

            return hierarchy;
        }

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

            return null;
        }

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

            return null;
        }

        Repository repository = new Repository( site.getId(), site.getUrl() );
        if ( StringUtils.isEmpty( repository.getBasedir() ) )
        {
            return repository.getHost();
        }
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(), null, appendPaths ) );
                    }
                }
            }

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

                                                                    org.apache.maven.model.v3_0_0.Model v3Model )
        throws PomTranslationException
    {
        DistributionManagement distributionManagement = new DistributionManagement();

        Site site = null;

        String siteAddress = v3Model.getSiteAddress();

        String siteDirectory = v3Model.getSiteDirectory();

        if ( StringUtils.isEmpty( siteAddress ) )
        {
            if ( !StringUtils.isEmpty( siteDirectory ) )
            {
                site = new Site();

                site.setId( "default" );

                site.setName( "Default Site" );

                site.setUrl( "file://" + siteDirectory );
            }
        }
        else
        {
            if ( StringUtils.isEmpty( siteDirectory ) )
            {
                throw new PomTranslationException( pomKey.groupId(), pomKey.artifactId(), pomKey.version(),
                                                   "Missing 'siteDirectory': Both siteAddress and siteDirectory must be set at the same time." );
            }

            site = new Site();

            site.setId( "default" );

            site.setName( "Default Site" );

            site.setUrl( "scp://" + siteAddress + "/" + siteDirectory );
        }

        distributionManagement.setSite( site );

        String distributionSite = v3Model.getDistributionSite();
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

    @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

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

    @Override
    protected Site determineDeploySite()
        throws MojoExecutionException
    {
        Site top = new Site();

        top.setId( stagingRepoId() );
        getLog().info( "Using this server ID for stage deploy: " + top.getId() );

        String stagingURL = determineStageDeploySiteURL();
        getLog().info( "Using this base URL for stage deploy: " + stagingURL );

        top.setUrl( stagingURL );

        return top;
    }
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.