Package org.apache.maven.model

Examples of org.apache.maven.model.Site


        }

        DistributionManagement dist = model.getDistributionManagement();
        if ( dist != null )
        {
            Site site = dist.getSite();
            if ( site != null )
            {
                site.setUrl( normalize( site.getUrl() ) );
            }
        }
    }
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

            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

        if ( src == null )
        {
            return null;
        }
       
        Site result = new Site();
       
        result.setId( src.getId() );
        result.setName( src.getName() );
        result.setUrl( src.getUrl() );
       
        return result;
    }
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

        snapshotRepository.setName( "name" );
        snapshotRepository.setLayout( "legacy" );
        snapshotRepository.setUniqueVersion( false );
        distributionManagement.setSnapshotRepository( snapshotRepository );

        Site site = new Site();
        site.setId( "apache.website" );
        site.setUrl( "scp://minotaur.apache.org/www/maven.apache.org/" );
        site.setName( "name3" );
        distributionManagement.setSite( site );

        parent.setDistributionManagement( distributionManagement );

        assembler.assembleModelInheritance( child, parent );

        DistributionManagement childDistMgmt = child.getDistributionManagement();
        assertNotNull( "Check distMgmt inherited", childDistMgmt );
        assertNull( "Check status NOT inherited", childDistMgmt.getStatus() );
        assertNull( "Check relocation NOT inherited", childDistMgmt.getRelocation() );
        assertEquals( "Check downloadUrl inherited", distributionManagement.getDownloadUrl(),
                      childDistMgmt.getDownloadUrl() );

        Site childSite = childDistMgmt.getSite();
        assertNotNull( "Check site inherited", childSite );
        assertEquals( "Check id matches", site.getId(), childSite.getId() );
        assertEquals( "Check name matches", site.getName(), childSite.getName() );
        assertEquals( "Check url matches with appended path", site.getUrl() + "child", childSite.getUrl() );

        assertRepositoryBase( childDistMgmt.getRepository(), repository );
        assertRepositoryBase( childDistMgmt.getSnapshotRepository(), snapshotRepository );
        assertEquals( "Check uniqueVersion is inherited", snapshotRepository.isUniqueVersion(),
                      childDistMgmt.getSnapshotRepository().isUniqueVersion() );
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

            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

            model.setDistributionManagement( new DistributionManagement() );
        }

        if ( model.getDistributionManagement().getSite() == null )
        {
            model.getDistributionManagement().setSite( new Site() );
        }

        model.getDistributionManagement().getSite().setUrl( url );
    }
View Full Code Here

     * @param parser
     */
    private Site parseSite(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        Site site = new Site();
        site.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "id" )  )
            {
                if ( parsed.contains( "id" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "id" );
                site.setId( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "name" )  )
            {
                if ( parsed.contains( "name" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "name" );
                site.setName( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "url" )  )
            {
                if ( parsed.contains( "url" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "url" );
                site.setUrl( getTrimmedValue( parser.nextText()) );
            }
            else
            {
                if ( strict )
                {
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.