Package org.apache.maven.settings

Examples of org.apache.maven.settings.RepositoryPolicy


            }
            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 ) );
View Full Code Here


    private static RepositoryPolicy disableUpdates( RepositoryPolicy policy )
    {
        if ( policy == null )
        {
            policy = new RepositoryPolicy();
        }

        policy.setUpdatePolicy( "never" );

        return policy;
View Full Code Here

      if ("default".equals(layout))
         result.setLayout(new DefaultRepositoryLayout());
      else if ("p2".equals(layout))
         result.setLayout(new P2ArtifactRepositoryLayout());

      RepositoryPolicy releases = repository.getReleases();
      if (releases != null)
         result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
                  releases.getChecksumPolicy()));

      RepositoryPolicy snapshots = repository.getSnapshots();
      if (snapshots != null)
         result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(snapshots.isEnabled(),
                  snapshots.getUpdatePolicy(),
                  snapshots.getChecksumPolicy()));

      return result;
   }
View Full Code Here

      if ("default".equals(layout))
         result.setLayout(new DefaultRepositoryLayout());
      else if ("flat".equals(layout))
         result.setLayout(new FlatRepositoryLayout());

      RepositoryPolicy releases = repository.getReleases();
      if (releases != null)
         result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
                  releases.getChecksumPolicy()));

      RepositoryPolicy snapshots = repository.getSnapshots();
      if (snapshots != null)
         result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(snapshots.isEnabled(),
                  snapshots.getUpdatePolicy(),
                  snapshots.getChecksumPolicy()));

      return result;
   }
View Full Code Here

        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 RepositoryPolicy
     */
    private RepositoryPolicy parseRepositoryPolicy( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        RepositoryPolicy repositoryPolicy = new RepositoryPolicy();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "enabled", null, parsed ) )
            {
                repositoryPolicy.setEnabled( getBooleanValue( getTrimmedValue( parser.nextText() ), "enabled", parser, "true" ) );
            }
            else if ( checkFieldWithDuplicate( parser, "updatePolicy", null, parsed ) )
            {
                repositoryPolicy.setUpdatePolicy( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "checksumPolicy", null, parsed ) )
            {
                repositoryPolicy.setChecksumPolicy( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

    private static RepositoryPolicy disableUpdates( RepositoryPolicy policy )
    {
        if ( policy == null )
        {
            policy = new RepositoryPolicy();
        }

        policy.setUpdatePolicy( "never" );

        return policy;
View Full Code Here

            }
            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 ) );
View Full Code Here

      if ("default".equals(layout))
         result.setLayout(new DefaultRepositoryLayout());
      else if ("flat".equals(layout))
         result.setLayout(new FlatRepositoryLayout());

      RepositoryPolicy releases = repository.getReleases();
      if (releases != null)
         result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
                  releases.getChecksumPolicy()));

      RepositoryPolicy snapshots = repository.getSnapshots();
      if (snapshots != null)
         result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(snapshots.isEnabled(),
                  snapshots.getUpdatePolicy(),
                  snapshots.getChecksumPolicy()));

      return result;
   }
View Full Code Here

      else if ("flat".equals(layout))
         result.setLayout(new FlatRepositoryLayout());
      else if ("p2".equals(layout))
         result.setLayout(new P2ArtifactRepositoryLayout());

      RepositoryPolicy releases = repository.getReleases();
      if (releases != null)
         result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
                  releases.getChecksumPolicy()));

      RepositoryPolicy snapshots = repository.getSnapshots();
      if (snapshots != null)
         result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(snapshots.isEnabled(),
                  snapshots.getUpdatePolicy(),
                  snapshots.getChecksumPolicy()));

      return result;
   }
View Full Code Here

TOP

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

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.