Package org.sonatype.aether.repository

Examples of org.sonatype.aether.repository.Authentication


    private static Proxy toProxy( org.apache.maven.repository.Proxy proxy )
    {
        Proxy result = null;
        if ( proxy != null )
        {
            Authentication auth = new Authentication( proxy.getUserName(), proxy.getPassword() );
            result = new Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), auth );
        }
        return result;
    }
View Full Code Here


         DefaultAuthenticationSelector authSelector = new LazyAuthenticationSelector(mirrorSelector);
         for (Server server : settings.getServers())
         {
            authSelector.add(
                     server.getId(),
                     new Authentication(server.getUsername(), server.getPassword(), server.getPrivateKey(), server
                              .getPassphrase()));
         }
         repositorySession.setAuthenticationSelector(authSelector);

         request.setRepositorySession(repositorySession);
View Full Code Here

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

                String proxyType = Proxy.TYPE_HTTP;
                if (repo.getUrl().startsWith("https"))
                    proxyType = Proxy.TYPE_HTTPS;
                Proxy proxy = new Proxy(proxyType, bcc.getProxyHost(), bcc.getProxyPort(), null);
                if (bcc.getProxyUser() != null) {
                    Authentication authentication = new Authentication(bcc.getProxyUser(), bcc.getProxyPassword());
                    proxy.setAuthentication(authentication);
                }
                repo.setProxy(proxy);
            }
            return repo;
View Full Code Here

            resolutionHelper.init(allMavenProps);

            String releaseRepoUrl = resolutionHelper.getRepoReleaseUrl();
            String snapshotRepoUrl = resolutionHelper.getRepoSnapshotUrl();

            Authentication authentication = null;
            if (StringUtils.isNotBlank(resolutionHelper.getRepoUsername())) {
                authentication = new Authentication(resolutionHelper.getRepoUsername(), resolutionHelper.getRepoPassword());
            }
            Proxy proxy = null;
            if (StringUtils.isNotBlank(resolutionHelper.getProxyHost())) {
                proxy = new Proxy(null, resolutionHelper.getProxyHost(), resolutionHelper.getProxyPort(),
                        new Authentication(resolutionHelper.getProxyUsername(), resolutionHelper.getProxyPassword()));
            }

            if (StringUtils.isNotBlank(snapshotRepoUrl)) {
                logger.debug("Enforcing snapshot repository for resolution: " + snapshotRepoUrl);
                RepositoryPolicy releasePolicy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN);
View Full Code Here

        Settings settings = MavenSettings.getSettings();
        Server server = settings.getServer( repo.getId() );

        if ( server != null ) {
            remoteRepo.setAuthentication( new Authentication( server.getUsername(), server.getPassword() ) );
        }

        return remoteRepo;
    }
View Full Code Here

            String proxyType = Proxy.TYPE_HTTP;
            if (repo.getUrl().startsWith("https"))
                proxyType = Proxy.TYPE_HTTPS;
            Proxy proxy = new Proxy(proxyType, proxyHost, Integer.parseInt(proxyPort), null);
            if (proxyUser != null) {
                Authentication authentication = new Authentication(proxyUser, proxyPass);
                proxy.setAuthentication(authentication);
            }
            repo.setProxy(proxy);
        }
View Full Code Here

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

            String proxyType = Proxy.TYPE_HTTP;
            if (repo.getUrl().startsWith("https"))
                proxyType = Proxy.TYPE_HTTPS;
            Proxy proxy = new Proxy(proxyType, proxyHost, Integer.parseInt(proxyPort), null);
            if (proxyUser != null) {
                Authentication authentication = new Authentication(proxyUser, proxyPass);
                proxy.setAuthentication(authentication);
            }
            repo.setProxy(proxy);
        }
View Full Code Here

    public static Authenticator fuseAuthenticator = new FuseRepoAuthenticator();

    public static class FuseRepoAuthenticator extends Authenticator {
        @Override
        protected PasswordAuthentication getPasswordAuthentication() {
            Authentication authentication = Authentications.getFuseRepoAuthentication();
            String username = authentication.getUsername();
            String password = authentication.getPassword();
            return new PasswordAuthentication(username, password.toCharArray());
        }
View Full Code Here

TOP

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