Package org.apache.maven.settings

Examples of org.apache.maven.settings.Repository


        if ( ( profile.getRepositories() != null ) && ( profile.getRepositories().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "repositories" );
            for ( Iterator iter = profile.getRepositories().iterator(); iter.hasNext(); )
            {
                Repository o = (Repository) iter.next();
                writeRepository( o, "repository", serializer );
            }
            serializer.endTag( NAMESPACE, "repositories" );
        }
        if ( ( profile.getPluginRepositories() != null ) && ( profile.getPluginRepositories().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "pluginRepositories" );
            for ( Iterator iter = profile.getPluginRepositories().iterator(); iter.hasNext(); )
            {
                Repository o = (Repository) iter.next();
                writeRepository( o, "pluginRepository", serializer );
            }
            serializer.endTag( NAMESPACE, "pluginRepositories" );
        }
        if ( ( profile.getId() != null ) && !profile.getId().equals( "default" ) )
View Full Code Here


     */
    private Repository parseRepository( XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        Repository repository = new Repository();
        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
        {
            String name = parser.getAttributeName( i );
            String value = parser.getAttributeValue( i );

            if ( name.indexOf( ':' ) >= 0 )
            {
                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
            }
            else
            {
                checkUnknownAttribute( parser, name, tagName, strict );
            }
        }
        java.util.Set parsed = new java.util.HashSet();
        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "releases", null, parsed ) )
            {
                repository.setReleases( parseRepositoryPolicy( parser, strict ) );
            }
            else if ( checkFieldWithDuplicate( parser, "snapshots", null, parsed ) )
            {
                repository.setSnapshots( parseRepositoryPolicy( parser, strict ) );
            }
            else if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
            {
                repository.setId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
            {
                repository.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
            {
                repository.setUrl( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
            {
                repository.setLayout( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
                checkUnknownElement( parser, strict );
            }
View Full Code Here

TOP

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

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.