Package org.apache.maven.artifact.ant

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


  public void execute(Upload upload) {
    // todo : unfortunately I have no idea how to apply this to non MavenDeployer-type repos...
    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


        deployTask.setUniqueVersion(true);
        return deployTask;
    }

    private void addRepository(CustomDeployTask deployTask, MavenArtifactRepository artifactRepository) {
        RemoteRepository mavenRepository = new MavenRemoteRepositoryFactory(artifactRepository).create();
        deployTask.addRemoteRepository(mavenRepository);
    }
View Full Code Here

    public MavenRemoteRepositoryFactory(MavenArtifactRepository artifactRepository) {
        this.artifactRepository = artifactRepository;
    }

    public RemoteRepository create() {
        RemoteRepository remoteRepository = new RemoteRepository();
        remoteRepository.setUrl(artifactRepository.getUrl().toString());

        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.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.