Package org.eclipse.aether.repository

Examples of org.eclipse.aether.repository.RemoteRepository


        return results;
    }

    public static RemoteRepository toRepo( ArtifactRepository repo )
    {
        RemoteRepository result = null;
        if ( repo != null )
        {
            RemoteRepository.Builder builder =
                new RemoteRepository.Builder( repo.getId(), getLayout( repo ), repo.getUrl() );
            builder.setSnapshotPolicy( toPolicy( repo.getSnapshots() ) );
View Full Code Here


  public void addResolver(Map<String, Object> args) {
    String name = (String) args.get("name");
    String root = (String) args.get("root");
    RemoteRepository.Builder builder = new RemoteRepository.Builder(name, "default",
        root);
    RemoteRepository repository = builder.build();
    addRepository(repository);
  }
View Full Code Here

    this.repositories.add(0, repository);
  }

  private RemoteRepository getPossibleMirror(RemoteRepository remoteRepository) {
    RemoteRepository mirror = this.session.getMirrorSelector().getMirror(
        remoteRepository);
    if (mirror != null) {
      return mirror;
    }
View Full Code Here

    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();

    new SettingsXmlRepositorySystemSessionAutoConfiguration(userHome).apply(session,
        this.repositorySystem);

    RemoteRepository repository = new RemoteRepository.Builder("my-server",
        "default", "http://maven.example.com").build();

    assertMirrorSelectorConfiguration(session, repository);
    assertProxySelectorConfiguration(session, repository);
    assertAuthenticationSelectorConfiguration(session, repository);
View Full Code Here

        authenticationContext.get(AuthenticationContext.PASSWORD));
  }

  private void assertMirrorSelectorConfiguration(
      DefaultRepositorySystemSession session, RemoteRepository repository) {
    RemoteRepository mirror = session.getMirrorSelector().getMirror(repository);
    assertNotNull("No mirror configured for repository " + repository.getId(), mirror);
    assertEquals("maven.example.com", mirror.getHost());
  }
View Full Code Here

      final DefaultMirrorSelector mirrorSelector = createMirrorSelector(settings);

      final List<RemoteRepository> mirrorsForSettingsRepos = new ArrayList<>();
      for (Iterator<RemoteRepository> iter = settingsRepos.iterator(); iter.hasNext();)
      {
         RemoteRepository settingsRepository = iter.next();
         RemoteRepository repoMirror = mirrorSelector.getMirror(settingsRepository);
         // If a mirror is available for a repository, then remove the repo, and use the mirror instead
         if (repoMirror != null)
         {
            iter.remove();
            mirrorsForSettingsRepos.add(repoMirror);
View Full Code Here

   }

   @Override
   public Authentication getAuthentication(RemoteRepository repository)
   {
      RemoteRepository mirror = mirrorSelector.getMirror(repository);
      if (mirror != null)
      {
         return defaultAuthSelector.getAuthentication(mirror);
      }
      return defaultAuthSelector.getAuthentication(repository);
View Full Code Here

        for (Map.Entry<String, String> entry : entries) {
            String key = entry.getKey();
           
            if(!key.startsWith("repo.")) continue;

            RemoteRepository repo = parser.parseRepository(substringAfter(key, "repo."), entry.getValue());

            if(repo.getHost().equals("repo1.maven.org")) hasCentral = true;

            repositories.add(repo);
        }

        if(!hasCentral){
View Full Code Here

    public void artifactDownloading(RepositoryEvent event) {
        out.println("downloading " + toUrl(event));
    }

    private String toUrl(RepositoryEvent event) {
        RemoteRepository repository = (RemoteRepository) event.getRepository();
        String path = lrm.getPathForRemoteArtifact(event.getArtifact(), repository, null);
        String url = repository.getUrl() + "/" + path;
        if (repository.getProxy() != null )
            url += " via proxy " + repository.getProxy();
        return url;
    }
View Full Code Here

        for( Dependency dependency: dependencies ){
            collectRequest.addDependency( dependency );
        }

        for( RemoteRepository r: repos ){
            RemoteRepository mirror = settings.getMirrorSelector().getMirror( r );
            if ( mirror != null )
            {
                r = mirror;
            }
            Proxy proxy = settings.getProxySelector().getProxy( r );if ( proxy != null )
View Full Code Here

TOP

Related Classes of org.eclipse.aether.repository.RemoteRepository

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.