Tabnine Logo
ArtifactRepository.getAuthentication
Code IndexAdd Tabnine to your IDE (free)

How to use
getAuthentication
method
in
org.apache.maven.artifact.repository.ArtifactRepository

Best Java code snippets using org.apache.maven.artifact.repository.ArtifactRepository.getAuthentication (Showing top 15 results out of 315)

origin: apache/maven

private AuthenticationInfo authenticationInfo( ArtifactRepository repository )
{
  AuthenticationInfo ai = new AuthenticationInfo();
  ai.setUserName( repository.getAuthentication().getUsername() );
  ai.setPassword( repository.getAuthentication().getPassword() );
  return ai;
}
origin: apache/maven

String getRepositoryKey( ArtifactRepository repository )
{
  StringBuilder buffer = new StringBuilder( 256 );
  Proxy proxy = repository.getProxy();
  if ( proxy != null )
  {
    if ( proxy.getUserName() != null )
    {
      int hash = ( proxy.getUserName() + proxy.getPassword() ).hashCode();
      buffer.append( hash ).append( '@' );
    }
    buffer.append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '>' );
  }
  // consider the username&password because a repo manager might block artifacts depending on authorization
  Authentication auth = repository.getAuthentication();
  if ( auth != null )
  {
    int hash = ( auth.getUsername() + auth.getPassword() ).hashCode();
    buffer.append( hash ).append( '@' );
  }
  // consider the URL (instead of the id) as this most closely relates to the contents in the repo
  buffer.append( repository.getUrl() );
  return buffer.toString();
}
origin: apache/maven

               snapshotPolicy, releasePolicy );
effectiveRepository.setAuthentication( aliasedRepo.getAuthentication() );
origin: apache/maven

        snapshotPolicy, releasePolicy );
effectiveRepository.setAuthentication( aliasedRepo.getAuthentication() );
origin: apache/maven

&& deploymentRepository.getAuthentication() == null )
origin: apache/maven

if ( repository.getAuthentication() != null && repository.getProxy() != null )
else if ( repository.getAuthentication() != null )
origin: apache/maven

public static RemoteRepository toRepo( ArtifactRepository repo )
{
  RemoteRepository result = null;
  if ( repo != null )
  {
    RemoteRepository.Builder builder =
      new RemoteRepository.Builder( repo.getId(), getLayout( repo ), repo.getUrl() );
    builder.setSnapshotPolicy( toPolicy( repo.getSnapshots() ) );
    builder.setReleasePolicy( toPolicy( repo.getReleases() ) );
    builder.setAuthentication( toAuthentication( repo.getAuthentication() ) );
    builder.setProxy( toProxy( repo.getProxy() ) );
    builder.setMirroredRepositories( toRepos( repo.getMirroredRepositories() ) );
    result = builder.build();
  }
  return result;
}
origin: org.jvnet.hudson.main/maven-plugin

public Authentication getAuthentication()
{
  return artifactRepository.getAuthentication();
}
public void setProxy( Proxy proxy )
origin: jenkinsci/maven-plugin

public Authentication getAuthentication()
{
  return artifactRepository.getAuthentication();
}
public void setProxy( Proxy proxy )
origin: spring-projects/sts4

private String getLastUpdatedKey(ArtifactRepository repository, Artifact artifact) {
  StringBuilder key = new StringBuilder();
  // repository part
  key.append(repository.getId());
  if (repository.getAuthentication() != null) {
    key.append('|').append(repository.getAuthentication().getUsername());
  }
  key.append('|').append(repository.getUrl());
  // artifact part
  key.append('|').append(artifact.getClassifier());
  return key.toString();
}
origin: spring-projects/sts4

private List<ArtifactRepository> removeDuplicateRepositories(ArrayList<ArtifactRepository> repositories) {
  ArrayList<ArtifactRepository> result = new ArrayList<ArtifactRepository>();
  HashSet<String> keys = new HashSet<String>();
  for (ArtifactRepository repository : repositories) {
    StringBuilder key = new StringBuilder();
    if (repository.getId() != null) {
      key.append(repository.getId());
    }
    key.append(':').append(repository.getUrl()).append(':');
    if (repository.getAuthentication() != null && repository.getAuthentication().getUsername() != null) {
      key.append(repository.getAuthentication().getUsername());
    }
    if (keys.add(key.toString())) {
      result.add(repository);
    }
  }
  return result;
}
origin: egineering-llc/gitflow-helper-maven-plugin

/**
 * Builds a RemoteRepository for resolving artifacts.
 *
 * @param altRepository the repository identifier or alt-syntax specification
 * @return the resolve remote repository
 * @throws MojoExecutionException if the provided repository specification defines an invalid repository layout
 * @throws MojoFailureException if the provided repository specification is invalid
 */
RemoteRepository getRepository(final String altRepository) throws MojoExecutionException, MojoFailureException {
  if (getLog().isDebugEnabled()) {
    getLog().debug("Creating remote Aether repository (to resolve remote artifacts) for: " + altRepository);
  }
  // Get an appropriate injected ArtifactRepository. (This resolves authentication in the 'normal' manner from Maven)
  ArtifactRepository remoteArtifactRepo = getDeploymentRepository(altRepository);
  if (getLog().isDebugEnabled()) {
    getLog().debug("Resolved maven deployment repository. Transcribing to Aether Repository...");
  }
  RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(remoteArtifactRepo.getId(), remoteArtifactRepo.getLayout().getId(), remoteArtifactRepo.getUrl());
  // Add authentication.
  if (remoteArtifactRepo.getAuthentication() != null) {
    if (getLog().isDebugEnabled()) {
      getLog().debug("Maven deployment repsoitory has Authentication. Transcribing to Aether Authentication...");
    }
    remoteRepoBuilder.setAuthentication(new AuthenticationBuilder().addUsername(remoteArtifactRepo.getAuthentication().getUsername())
        .addPassword(remoteArtifactRepo.getAuthentication().getPassword())
        .addPrivateKey(remoteArtifactRepo.getAuthentication().getPrivateKey(), remoteArtifactRepo.getAuthentication().getPassphrase())
        .build());
  }
  return remoteRepoBuilder.build();
}
origin: wildfly-swarm-archive/ARCHIVE-wildfly-swarm

public void remoteRepository(ArtifactRepository repo) {
  RemoteRepository.Builder builder = new RemoteRepository.Builder(repo.getId(), "default", repo.getUrl());
  final Authentication mavenAuth = repo.getAuthentication();
  if (mavenAuth != null && mavenAuth.getUsername() != null && mavenAuth.getPassword() != null) {
    builder.setAuthentication(new AuthenticationBuilder()
        .addUsername(mavenAuth.getUsername())
        .addPassword(mavenAuth.getPassword()).build());
  }
  this.remoteRepositories.add(builder.build());
}
origin: takari/takari-lifecycle

public static RemoteRepository toRepo(ArtifactRepository repo) {
 RemoteRepository result = null;
 if (repo != null) {
  RemoteRepository.Builder builder = new RemoteRepository.Builder(repo.getId(), getLayout(repo), repo.getUrl());
  builder.setSnapshotPolicy(toPolicy(repo.getSnapshots()));
  builder.setReleasePolicy(toPolicy(repo.getReleases()));
  builder.setAuthentication(toAuthentication(repo.getAuthentication()));
  builder.setProxy(toProxy(repo.getProxy()));
  builder.setMirroredRepositories(toRepos(repo.getMirroredRepositories()));
  result = builder.build();
 }
 return result;
}
origin: io.takari.maven.plugins/takari-lifecycle-plugin

public static RemoteRepository toRepo(ArtifactRepository repo) {
 RemoteRepository result = null;
 if (repo != null) {
  RemoteRepository.Builder builder = new RemoteRepository.Builder(repo.getId(), getLayout(repo), repo.getUrl());
  builder.setSnapshotPolicy(toPolicy(repo.getSnapshots()));
  builder.setReleasePolicy(toPolicy(repo.getReleases()));
  builder.setAuthentication(toAuthentication(repo.getAuthentication()));
  builder.setProxy(toProxy(repo.getProxy()));
  builder.setMirroredRepositories(toRepos(repo.getMirroredRepositories()));
  result = builder.build();
 }
 return result;
}
org.apache.maven.artifact.repositoryArtifactRepositorygetAuthentication

Popular methods of ArtifactRepository

  • getBasedir
  • pathOf
  • getUrl
  • getId
  • getLayout
  • getSnapshots
  • getReleases
  • find
  • pathOfLocalRepositoryMetadata
  • getProtocol
  • pathOfRemoteRepositoryMetadata
  • setAuthentication
  • pathOfRemoteRepositoryMetadata,
  • setAuthentication,
  • getProxy,
  • setProxy,
  • setUrl,
  • isBlacklisted,
  • setId,
  • setLayout,
  • findVersions

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now