Package org.apache.maven.settings

Examples of org.apache.maven.settings.Repository


            {
                profile.setId( "stagedLocalRepo" + entropy.nextLong() );
            }
            while ( settings.getProfilesAsMap().containsKey( profile.getId() ) );

            Repository repository = new Repository();
            repository.setId( profile.getId() + entropy.nextLong() );
            RepositoryPolicy policy = new RepositoryPolicy();
            policy.setEnabled( true );
            policy.setChecksumPolicy( "ignore" );
            policy.setUpdatePolicy( "never" );
            repository.setReleases( policy );
            repository.setSnapshots( policy );
            repository.setLayout( "default" );
            repository.setName( "Original Local Repository" );
            repository.setUrl( toUrl( localRepo ) );
            profile.addPluginRepository( repository );
            profile.addRepository( repository );
            settings.addProfile( profile );
            settings.addActiveProfile( profile.getId() );
            settings.setLocalRepository( stagedLocalRepo.getAbsolutePath() );
View Full Code Here


    {
        if ( repositories != null )
        {
            for ( Iterator<Repository> it = repositories.iterator(); it.hasNext(); )
            {
                Repository repo = it.next();
                repo.setReleases( disableUpdates( repo.getReleases() ) );
                repo.setSnapshots( disableUpdates( repo.getSnapshots() ) );
            }
        }
    }
View Full Code Here

   }

   @Test
   public void testRepositoryP2Support()
   {
      Repository repository = new Repository();
      repository.setLayout("p2");
      repository.setId("swtbot");
      repository.setName("swtbot-nightly-staging-site");
      repository.setUrl("http://download.eclipse.org/technology/swtbot/snapshots");
      ArtifactRepository mavenRepo = RepositoryUtils.convertFromMavenSettingsRepository(repository);
      assertNotNull(mavenRepo);
      assertNotNull(mavenRepo.getLayout());
      assertEquals("p2", mavenRepo.getLayout().getId());
   }
View Full Code Here

    {
        Settings settings = new Settings();
        settings.setLocalRepository( getTestFile( "target/local-repository" ).getAbsolutePath() );
        Profile profile = new Profile();
        profile.setId( "repo" );
        Repository repository = new Repository();
        repository.setId( "central" );
        repository.setUrl( getTestFile( "src/test/test-repo" ).toURI().toString() );
        RepositoryPolicy policy = new RepositoryPolicy();
        policy.setEnabled( true );
        policy.setUpdatePolicy( "always" );
        repository.setSnapshots( policy );
        profile.addRepository( repository );
        settings.addProfile( profile );
        settings.addActiveProfile( "repo" );
        return settings;
    }
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

            modifiedRepositoryMap.put( repository.getId().trim(), repository );
        }

        for ( Map.Entry<String, Repository> entry : modifiedRepositoryMap.entrySet() )
        {
            Repository repo1 = entry.getValue();
            Repository repo2 = originalRepositoryMap.get( entry.getKey() );

            if ( ( repo2 == null ) || hasRepositoryPolicyDiff( repo1.getSnapshots(), repo2.getSnapshots() )
                || hasRepositoryPolicyDiff( repo1.getReleases(), repo2.getReleases() ) )
            {
                list.add( repo1 );
            }
        }
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" );
            }
            if ( ( profile.getId() != null ) && !profile.getId().equals( "default" ) )
View Full Code Here

            modifiedRepositoryMap.put( repository.getId().trim(), repository );
        }

        for ( Map.Entry<String, Repository> entry : modifiedRepositoryMap.entrySet() )
        {
            Repository repo1 = entry.getValue();
            Repository repo2 = originalRepositoryMap.get( entry.getKey() );

            if ( hasRepositoryPolicyDiff( repo1.getSnapshots(), repo2.getSnapshots() )
                || hasRepositoryPolicyDiff( repo1.getReleases(), repo2.getReleases() ) )
            {
                list.add( repo1 );
            }
        }
View Full Code Here

            {
                profile.setId( "stagedLocalRepo" + entropy.nextLong() );
            }
            while ( settings.getProfilesAsMap().containsKey( profile.getId() ) );

            Repository repository = new Repository();
            repository.setId( profile.getId() + entropy.nextLong() );
            RepositoryPolicy policy = new RepositoryPolicy();
            policy.setEnabled( true );
            policy.setChecksumPolicy( "ignore" );
            policy.setUpdatePolicy( "never" );
            repository.setReleases( policy );
            repository.setSnapshots( policy );
            repository.setLayout( "default" );
            repository.setName( "Original Local Repository" );
            repository.setUrl( toUrl( localRepo ) );
            profile.addPluginRepository( repository );
            profile.addRepository( repository );
            settings.addProfile( profile );
            settings.addActiveProfile( profile.getId() );
            settings.setLocalRepository( stagedLocalRepo.getAbsolutePath() );
View Full Code Here

    {
        if ( repositories != null )
        {
            for ( Iterator<Repository> it = repositories.iterator(); it.hasNext(); )
            {
                Repository repo = it.next();
                repo.setReleases( disableUpdates( repo.getReleases() ) );
                repo.setSnapshots( disableUpdates( repo.getSnapshots() ) );
            }
        }
    }
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.