Package org.sonatype.aether.repository

Examples of org.sonatype.aether.repository.RemoteRepository


        return pomArtifact;
    }

    public static RemoteRepository toRemoteRepository( Repository repository )
    {
        RemoteRepository result =
            new RemoteRepository( repository.getId(), repository.getLayout(), repository.getUrl() );
        result.setPolicy( true, toRepositoryPolicy( repository.getSnapshots() ) );
        result.setPolicy( false, toRepositoryPolicy( repository.getReleases() ) );
        return result;
    }
View Full Code Here


        for (RemoteRepository r : m_remoteRepos) {
            naming.put(r.getId(), r);

            r.setProxy(m_proxySelector.getProxy(r));

            RemoteRepository mirror = m_mirrorSelector.getMirror(r);
            if (mirror != null) {
                String key = mirror.getId();
                naming.put(key, mirror);
                if (!map.containsKey(key)) {
                    map.put(key, new ArrayList<String>());
                }
                List<String> mirrored = map.get(key);
                mirrored.add(r.getId());
            }
        }

        for (String mirrorId : map.keySet()) {
            RemoteRepository mirror = naming.get(mirrorId);
            List<RemoteRepository> mirroedRepos = new ArrayList<RemoteRepository>();

            for (String rep : map.get(mirrorId)) {
                mirroedRepos.add(naming.get(rep));
            }
            mirror.setMirroredRepositories(mirroedRepos);
            m_remoteRepos.removeAll(mirroedRepos);
            m_remoteRepos.add(0, mirror);
        }

    }
View Full Code Here

    }

    private List<RemoteRepository> selectRepositories(List<MavenRepositoryURL> repos) {
        List<RemoteRepository> list = new ArrayList<RemoteRepository>();
        for (MavenRepositoryURL r : repos) {
            list.add(new RemoteRepository(r.getId(), REPO_TYPE, r.getURL().toExternalForm()));
        }
        return list;
    }
View Full Code Here

         if (profile != null)
         {
            List<Repository> repositories = profile.getRepositories();
            for (Repository repository : repositories)
            {
               settingsRepos.add(new RemoteRepository(repository.getId(), repository.getLayout(), repository.getUrl()));
            }
         }
      }
      return settingsRepos;
   }
View Full Code Here

class MavenConvertUtils
{
   static RemoteRepository convertToMavenRepo(final DependencyRepository repo, final Settings settings)
   {
      RemoteRepository remoteRepository = new RemoteRepository(repo.getId(), "default", repo.getUrl());
      Proxy activeProxy = settings.getActiveProxy();
      if (activeProxy != null)
      {
         Authentication auth = new Authentication(activeProxy.getUsername(), activeProxy.getPassword());
         remoteRepository.setProxy(new org.sonatype.aether.repository.Proxy(activeProxy.getProtocol(), activeProxy
                  .getHost(), activeProxy.getPort(), auth));
      }
      return remoteRepository;
   }
View Full Code Here

      return remoteRepos;
   }

   static RemoteRepository convertToMavenRepo(final String id, String url, final Settings settings)
   {
      RemoteRepository remoteRepository = new RemoteRepository(id, "default", url);
      Proxy activeProxy = settings.getActiveProxy();
      if (activeProxy != null)
      {
         Authentication auth = new Authentication(activeProxy.getUsername(), activeProxy.getPassword());
         remoteRepository.setProxy(new org.sonatype.aether.repository.Proxy(activeProxy.getProtocol(),
                  activeProxy
                           .getHost(), activeProxy.getPort(), auth));
      }
      return remoteRepository;
   }
View Full Code Here

         if (profile != null)
         {
            List<Repository> repositories = profile.getRepositories();
            for (Repository repository : repositories)
            {
               settingsRepos.add(new RemoteRepository(repository.getId(), repository.getLayout(), repository
                        .getUrl()));
            }
         }
      }
      return settingsRepos;
View Full Code Here

               }
            }
            if (ar instanceof RemoteRepository)
            {
               ArtifactRequest request = new ArtifactRequest();
               RemoteRepository remoteRepo = new RemoteRepository(ar.getId(), ar.getContentType(),
                        ((RemoteRepository) ar).getUrl());
               request.addRepository(remoteRepo);
               request.setArtifact(artifact);

               try
View Full Code Here

      return session;
   }

   private RemoteRepository convertToMavenRepo(final DependencyRepository repo)
   {
      RemoteRepository remoteRepository = new RemoteRepository(repo.getId(), "default", repo.getUrl());
      Settings settings = container.getSettings();
      Proxy activeProxy = settings.getActiveProxy();
      if (activeProxy != null)
      {
         remoteRepository.setProxy(RepositoryUtils.convertFromMavenProxy(activeProxy));
      }
      return remoteRepository;
   }
View Full Code Here

            hasCentral = true;
         }
      }
      if (!hasCentral)
      {
         RemoteRepository central = convertToMavenRepo(new DependencyRepositoryImpl(KnownRepository.CENTRAL.getId(),
                  KnownRepository.CENTRAL.getUrl()));
         central.setPolicy(true, new RepositoryPolicy().setEnabled(false));
         remoteRepos.add(central);
      }
      return remoteRepos;
   }
View Full Code Here

TOP

Related Classes of org.sonatype.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.