Package org.apache.maven.settings

Examples of org.apache.maven.settings.Mirror


            wagonManager.setDefaultRepositoryPermissions( defaultPermissions );

            for ( Iterator i = settings.getMirrors().iterator(); i.hasNext(); )
            {
                Mirror mirror = (Mirror) i.next();

                wagonManager.addMirror( mirror.getId(), mirror.getMirrorOf(), mirror.getUrl() );
            }
        }
        finally
        {
            container.release( wagonManager );
View Full Code Here


                    }
                }
   
                for ( Iterator i = settings.getMirrors().iterator(); i.hasNext(); )
                {
                    Mirror mirror = (Mirror) i.next();
   
                    wagonManager.addMirror( mirror.getId(), mirror.getMirrorOf(), mirror.getUrl() );
                }
            }
            finally
            {
                if ( sd != null )
View Full Code Here

    {
        if ( repositories != null && mirrors != null )
        {
            for ( ArtifactRepository repository : repositories )
            {
                Mirror mirror = getMirror( repository, mirrors );

                if ( mirror != null )
                {
                    repository.setId( mirror.getId() );
                    repository.setUrl( mirror.getUrl() );

                    if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
                    {
                        repository.setLayout( getLayout( mirror.getLayout() ) );
                    }
                }
            }
        }
    }
View Full Code Here

            if ( selector != null )
            {
                RemoteRepository repo = selector.getMirror( RepositoryUtils.toRepo( repository ) );
                if ( repo != null )
                {
                    Mirror mirror = new Mirror();
                    mirror.setId( repo.getId() );
                    mirror.setUrl( repo.getUrl() );
                    mirror.setLayout( repo.getContentType() );
                    return mirror;
                }
            }
        }
        return null;
View Full Code Here

    {
        if ( repositories != null && session != null )
        {
            for ( ArtifactRepository repository : repositories )
            {
                Mirror mirror = getMirror( session, repository );

                if ( mirror != null )
                {
                    repository.setId( mirror.getId() );
                    repository.setUrl( mirror.getUrl() );

                    if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
                    {
                        repository.setLayout( getLayout( mirror.getLayout() ) );
                    }
                }
            }
        }
    }
View Full Code Here

     * @return Mirror
     */
    private Mirror parseMirror( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        Mirror mirror = new Mirror();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "mirrorOf", null, parsed ) )
            {
                mirror.setMirrorOf( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
            {
                mirror.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
            {
                mirror.setUrl( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
            {
                mirror.setLayout( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "mirrorOfLayouts", null, parsed ) )
            {
                mirror.setMirrorOfLayouts( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
            {
                mirror.setId( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

            modifiedMirrorMap.put( mirror.getId().trim(), mirror );
        }

        for ( Map.Entry<String, Mirror> entry : modifiedMirrorMap.entrySet() )
        {
            Mirror mirror1 = entry.getValue();
            Mirror mirror2 = originalMirrorMap.get( entry.getKey() );

            if ( mirror2 == null || !isStringEqual( mirror1.getMirrorOf(), mirror2.getMirrorOf() )
                || !isStringEqual( mirror1.getUrl(), mirror2.getUrl() ) )
            {
                list.add( mirror1 );
            }
        }
View Full Code Here

            if ( ( settings.getMirrors() != null ) && ( settings.getMirrors().size() > 0 ) )
            {
                serializer.startTag( NAMESPACE, "mirrors" );
                for ( Iterator iter = settings.getMirrors().iterator(); iter.hasNext(); )
                {
                    Mirror o = (Mirror) iter.next();
                    writeMirror( o, "mirror", serializer );
                }
                serializer.endTag( NAMESPACE, "mirrors" );
            }
            if ( ( settings.getProfiles() != null ) && ( settings.getProfiles().size() > 0 ) )
View Full Code Here

            modifiedMirrorMap.put( mirror.getId().trim(), mirror );
        }

        for ( Map.Entry<String, Mirror> entry : modifiedMirrorMap.entrySet() )
        {
            Mirror mirror1 = entry.getValue();
            Mirror mirror2 = originalMirrorMap.get( entry.getKey() );

            if ( mirror2 == null || !isStringEqual( mirror1.getMirrorOf(), mirror2.getMirrorOf() )
                || !isStringEqual( mirror1.getUrl(), mirror2.getUrl() ) )
            {
                list.add( mirror1 );
            }
        }
View Full Code Here

            wagonManager.setDefaultRepositoryPermissions( defaultPermissions );

            for ( Iterator i = settings.getMirrors().iterator(); i.hasNext(); )
            {
                Mirror mirror = (Mirror) i.next();

                wagonManager.addMirror( mirror.getId(), mirror.getMirrorOf(), mirror.getUrl() );
            }
        }
        finally
        {
            container.release( wagonManager );
View Full Code Here

TOP

Related Classes of org.apache.maven.settings.Mirror

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.