Package org.eclipse.aether.repository

Examples of org.eclipse.aether.repository.RepositoryPolicy


        if (url == null && WELL_KNOWN_REPOS.containsKey(id))
            return createRepo(WELL_KNOWN_REPOS.get(id), allowSnapshots);
        if (url == null)
            url = id;

        RepositoryPolicy releasePolicy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_NEVER, RepositoryPolicy.CHECKSUM_POLICY_WARN);
        RepositoryPolicy snapshotPolicy = allowSnapshots ? releasePolicy : new RepositoryPolicy(false, null, null);

        if (url.startsWith("file:")) {
            releasePolicy = new RepositoryPolicy(releasePolicy.isEnabled(), releasePolicy.getUpdatePolicy(), RepositoryPolicy.CHECKSUM_POLICY_IGNORE);
            snapshotPolicy = releasePolicy;
        }
        return new RemoteRepository.Builder(id, "default", url).setReleasePolicy(releasePolicy).setSnapshotPolicy(snapshotPolicy).build();
    }
View Full Code Here


        this.forceRefresh = forceRefresh;
        this.offline = offline;

        this.session = newRepositorySession(system, localRepoPath);

        final RepositoryPolicy policy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_NEVER, RepositoryPolicy.CHECKSUM_POLICY_WARN);
        this.repos = new ArrayList<RemoteRepository>();

        if (repos == null)
            this.repos.add(newCentralRepository(policy));
        else {
View Full Code Here

        if (url == null && WELL_KNOWN_REPOS.containsKey(id))
            return createRepo(WELL_KNOWN_REPOS.get(id), allowSnapshots);
        if (url == null)
            url = id;

        RepositoryPolicy releasePolicy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_NEVER, RepositoryPolicy.CHECKSUM_POLICY_WARN);
        RepositoryPolicy snapshotPolicy = allowSnapshots ? releasePolicy : new RepositoryPolicy(false, null, null);

        if (url.startsWith("file:")) {
            releasePolicy = new RepositoryPolicy(releasePolicy.isEnabled(), releasePolicy.getUpdatePolicy(), RepositoryPolicy.CHECKSUM_POLICY_IGNORE);
            snapshotPolicy = releasePolicy;
        }
        return new RemoteRepository.Builder(id, "default", url).setReleasePolicy(releasePolicy).setSnapshotPolicy(snapshotPolicy).build();
    }
View Full Code Here

        this.session = newRepositorySession(system, localRepo);

        if (repos == null)
            repos = Arrays.asList("central");

        final RepositoryPolicy releasePolicy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_NEVER, RepositoryPolicy.CHECKSUM_POLICY_WARN);
        final RepositoryPolicy snapshotPolicy = allowSnapshots ? releasePolicy : new RepositoryPolicy(false, null, null);
        this.repos = new ArrayList<RemoteRepository>();
        for (String repo : repos)
            this.repos.add(newRemoteRepository(repo, WELL_KNOWN_REPOS.containsKey(repo) ? WELL_KNOWN_REPOS.get(repo) : repo, releasePolicy, snapshotPolicy));
       
        verbose("Dependency manager initialized with repositories: " + this.repos);
View Full Code Here

        return version.startsWith("(") || version.startsWith("[");
    }

    private static RemoteRepository newRemoteRepository(String name, String url, RepositoryPolicy releasePolicy, RepositoryPolicy snapshotPolicy) {
        if (url.startsWith("file:")) {
            releasePolicy = new RepositoryPolicy(releasePolicy.isEnabled(), releasePolicy.getUpdatePolicy(), RepositoryPolicy.CHECKSUM_POLICY_IGNORE);
            snapshotPolicy = releasePolicy;
        }
        return new RemoteRepository.Builder(name, "default", url).setReleasePolicy(releasePolicy).setSnapshotPolicy(snapshotPolicy).build();
    }
View Full Code Here

            }

            RemoteRepository.Builder builder = new RemoteRepository.Builder(id, layout, url);

            if(url.contains("snapshot")){
                builder.setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS,
                    RepositoryPolicy.CHECKSUM_POLICY_WARN));
            }

            return builder.build();
        }
View Full Code Here

            }

            RemoteRepository.Builder builder = new RemoteRepository.Builder(id, layout, url);

            if (url.contains("snapshot")) {
                builder.setPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS,
                    RepositoryPolicy.CHECKSUM_POLICY_WARN));
            }

            return builder.build();
        }
View Full Code Here

    public void addRepository(String id, String url){
        // only repositories with "default" layout
        Builder repo = new Builder(id, "default", url);
        // disable snapshots
        repo.setSnapshotPolicy( new RepositoryPolicy( false, null, null ) );
        // ebable releases
        repo.setReleasePolicy( null );
        repos.add( repo.build() );
    }
View Full Code Here

        // only repositories with "default" layout
        Builder repo = new Builder(id, "default", url);
        // enable snapshots
        repo.setSnapshotPolicy( null );
        // disable releases
        repo.setReleasePolicy( new RepositoryPolicy( false, null, null ) );
        repos.add( repo.build() );
    }
View Full Code Here

        this.forceRefresh = forceRefresh;
        this.offline = offline;

        this.session = newRepositorySession(system, localRepoPath);

        final RepositoryPolicy policy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_NEVER, RepositoryPolicy.CHECKSUM_POLICY_WARN);
        this.repos = new ArrayList<RemoteRepository>();

        if (repos == null)
            this.repos.add(newRemoteRepository("central", MAVEN_CENTRAL_URL, policy));
        else {
View Full Code Here

TOP

Related Classes of org.eclipse.aether.repository.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.