Package org.apache.maven.profiles

Examples of org.apache.maven.profiles.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" );
            }
            serializer.endTag( NAMESPACE, tagName );
View Full Code Here


     * @return Repository
     */
    private Repository parseRepository( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        Repository repository = new Repository();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "releases", null, parsed ) )
            {
                repository.setReleases( parseRepositoryPolicy( "releases", parser, strict ) );
            }
            else if ( checkFieldWithDuplicate( parser, "snapshots", null, parsed ) )
            {
                repository.setSnapshots( parseRepositoryPolicy( "snapshots", 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
            {
                if ( strict )
                {
View Full Code Here

            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" );
            }
            serializer.endTag( NAMESPACE, tagName );
View Full Code Here

     * @param parser
     */
    private Repository parseRepository(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        Repository repository = new Repository();
        repository.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "releases" )  )
            {
                if ( parsed.contains( "releases" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "releases" );
                repository.setReleases( parseRepositoryPolicy( "releases", parser, strict, encoding ) );
            }
            else if ( parser.getName().equals( "snapshots" )  )
            {
                if ( parsed.contains( "snapshots" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "snapshots" );
                repository.setSnapshots( parseRepositoryPolicy( "snapshots", parser, strict, encoding ) );
            }
            else if ( parser.getName().equals( "id" )  )
            {
                if ( parsed.contains( "id" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "id" );
                repository.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" );
                repository.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" );
                repository.setUrl( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "layout" )  )
            {
                if ( parsed.contains( "layout" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "layout" );
                repository.setLayout( getTrimmedValue( parser.nextText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

     * @return Repository
     */
    private Repository parseRepository( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        Repository repository = new Repository();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "releases", null, parsed ) )
            {
                repository.setReleases( parseRepositoryPolicy( "releases", parser, strict ) );
            }
            else if ( checkFieldWithDuplicate( parser, "snapshots", null, parsed ) )
            {
                repository.setSnapshots( parseRepositoryPolicy( "snapshots", 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
            {
                if ( strict )
                {
View Full Code Here

            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" );
            }
            serializer.endTag( NAMESPACE, tagName );
View Full Code Here

TOP

Related Classes of org.apache.maven.profiles.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.