Package org.eclipse.aether.repository

Examples of org.eclipse.aether.repository.Authentication


  }

  private ProxySelector createProxySelector(List<Proxy> proxies) {
    DefaultProxySelector selector = new DefaultProxySelector();
    for (Proxy proxy : proxies) {
      Authentication authentication = new AuthenticationBuilder()
          .addUsername(proxy.getUsername()).addPassword(proxy.getPassword())
          .build();
      selector.add(new org.eclipse.aether.repository.Proxy(proxy.getProtocol(),
          proxy.getHost(), proxy.getPort(), authentication), proxy
          .getNonProxyHosts());
View Full Code Here


    assertEquals("maven.example.com", mirror.getHost());
  }

  private void assertAuthenticationSelectorConfiguration(
      DefaultRepositorySystemSession session, RemoteRepository repository) {
    Authentication authentication = session.getAuthenticationSelector()
        .getAuthentication(repository);

    repository = new RemoteRepository.Builder(repository).setAuthentication(
        authentication).build();
View Full Code Here

        AetherGrapeEngine grapeEngine = createGrapeEngine();

        List<RemoteRepository> repositories = (List<RemoteRepository>) ReflectionTestUtils
            .getField(grapeEngine, "repositories");
        assertEquals(1, repositories.size());
        Authentication authentication = repositories.get(0).getAuthentication();
        assertNotNull(authentication);
      }
    });
  }
View Full Code Here

      Set<RemoteRepository> enrichedRepos = new HashSet<>();
      LazyAuthenticationSelector authSelector = createAuthSelector(settings, mirrorSelector);
      for (RemoteRepository settingsRepo : settingsRepos)
      {
         // Obtain the Authentication for the repository or it's mirror
         Authentication auth = authSelector.getAuthentication(settingsRepo);
         // All RemoteRepositories (Mirrors and Repositories) constructed so far lack Authentication info.
         // Use the settings repo as the prototype and create an enriched repo with the Authentication.
         enrichedRepos.add(new RemoteRepository.Builder(settingsRepo).setAuthentication(auth).build());
      }
      return new ArrayList<>(enrichedRepos);
View Full Code Here

   public static org.eclipse.aether.repository.Proxy convertFromMavenProxy(org.apache.maven.settings.Proxy proxy)
   {
      org.eclipse.aether.repository.Proxy result = null;
      if (proxy != null)
      {
         Authentication auth = new AuthenticationBuilder().addUsername(proxy.getUsername())
                  .addPassword(proxy.getPassword()).build();
         result = new org.eclipse.aether.repository.Proxy(proxy.getProtocol(), proxy.getHost(), proxy.getPort(), auth);
      }
      return result;
   }
View Full Code Here

   {
      RemoteRepository.Builder remoteRepositoryBuilder = new RemoteRepository.Builder(id, "default", url);
      Proxy activeProxy = settings.getActiveProxy();
      if (activeProxy != null)
      {
         Authentication auth = new AuthenticationBuilder().addUsername(activeProxy.getUsername())
                  .addPassword(activeProxy.getPassword()).build();
         remoteRepositoryBuilder.setProxy(new org.eclipse.aether.repository.Proxy(activeProxy.getProtocol(),
                  activeProxy
                           .getHost(), activeProxy.getPort(), auth));
      }
View Full Code Here

   public static org.eclipse.aether.repository.Proxy convertFromMavenProxy(org.apache.maven.settings.Proxy proxy)
   {
      org.eclipse.aether.repository.Proxy result = null;
      if (proxy != null)
      {
         Authentication auth = new AuthenticationBuilder().addUsername(proxy.getUsername()).addPassword(proxy.getPassword()).build();
         result = new org.eclipse.aether.repository.Proxy(proxy.getProtocol(), proxy.getHost(), proxy.getPort(), auth);
      }
      return result;
   }
View Full Code Here

   {
      RemoteRepository.Builder remoteRepositoryBuilder = new RemoteRepository.Builder(id, "default", url);
      Proxy activeProxy = settings.getActiveProxy();
      if (activeProxy != null)
      {
         Authentication auth = new AuthenticationBuilder().addUsername(activeProxy.getUsername())
                  .addPassword(activeProxy.getPassword()).build();
         remoteRepositoryBuilder.setProxy(new org.eclipse.aether.repository.Proxy(activeProxy.getProtocol(),
                  activeProxy
                           .getHost(), activeProxy.getPort(), auth));
      }
View Full Code Here

   public static org.eclipse.aether.repository.Proxy convertFromMavenProxy(org.apache.maven.settings.Proxy proxy)
   {
      org.eclipse.aether.repository.Proxy result = null;
      if (proxy != null)
      {
         Authentication auth = new AuthenticationBuilder().addUsername(proxy.getUsername())
                  .addPassword(proxy.getPassword()).build();
         result = new org.eclipse.aether.repository.Proxy(proxy.getProtocol(), proxy.getHost(), proxy.getPort(), auth);
      }
      return result;
   }
View Full Code Here

      RemoteRepository.Builder remoteRepositoryBuilder = new RemoteRepository.Builder(repo.getId(), "default",
               repo.getUrl());
      Proxy activeProxy = settings.getActiveProxy();
      if (activeProxy != null)
      {
         Authentication auth = new AuthenticationBuilder().addUsername(activeProxy.getUsername())
                  .addPassword(activeProxy.getPassword()).build();
         remoteRepositoryBuilder.setProxy(new org.eclipse.aether.repository.Proxy(activeProxy.getProtocol(),
                  activeProxy
                           .getHost(), activeProxy.getPort(), auth));
      }
View Full Code Here

TOP

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

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.