Package org.apache.maven.artifact.ant

Examples of org.apache.maven.artifact.ant.Authentication


    upload.getRepositories().withType( MavenDeployer.class ).all(
        new Action<MavenDeployer>() {
          public void execute(MavenDeployer deployer) {
            final RemoteRepository repository =  deployer.getRepository();
            if ( repository != null ) {
              final Authentication authentication = locateAuthenticationDetails( repository );
              if ( authentication != null ) {
                repository.addAuthentication( authentication );
              }
            }
            final RemoteRepository snapshotRepository = deployer.getSnapshotRepository();
            if ( snapshotRepository != null ) {
              final Authentication authentication = locateAuthenticationDetails( snapshotRepository );
              if ( authentication != null ) {
                snapshotRepository.addAuthentication( authentication );
              }
            }
          }
View Full Code Here


    );
  }

  private Authentication locateAuthenticationDetails(RemoteRepository repository) {
    for ( AuthenticationProvider provider : authenticationProviderRegistry.providers() ) {
      Authentication authentication = provider.determineAuthentication( repository );
      if ( authentication != null ) {
        return authentication;
      }
    }
    return null;
View Full Code Here

          final Element serverElement = (Element) serversIterator.next();
          final String id = extractValue( serverElement.element( "id" ) );
          if ( id == null ) {
            continue;
          }
          final Authentication authentication = new Authentication();
          authentication.setUserName( extractValue( serverElement.element( "username" ) ) );
          authentication.setPassword( extractValue( serverElement.element( "password" ) ) );
          authentication.setPrivateKey( extractValue( serverElement.element( "privateKey" ) ) );
          authentication.setPassphrase( extractValue( serverElement.element( "passphrase" ) ) );
          repositoryAuthenticationMap.put( id, authentication );
        }
      }
      catch (DocumentException e) {
        log.error( "Error reading Maven settings.xml", e );
View Full Code Here

        PasswordCredentials credentials = artifactRepository.getCredentials();
        String username = credentials.getUsername();
        String password = credentials.getPassword();

        if (username != null || password != null) {
            Authentication authentication = new Authentication();
            authentication.setUserName(username);
            authentication.setPassword(password);
            remoteRepository.addAuthentication(authentication);
        }

        return remoteRepository;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.ant.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.