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

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

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

origin: apache/maven

@Override
public String getId()
{
  return localRepository.getId();
}
origin: apache/maven

public String getId()
{
  return userLocalArtifactRepository.getId();
}
origin: apache/maven

private static int repositoryHashCode( ArtifactRepository repository )
{
  int result = 17;
  result = 31 * result + ( repository.getId() != null ? repository.getId().hashCode() : 0 );
  return result;
}
origin: apache/maven

private boolean isLocalRepository( ArtifactRepository repository )
{
  // unfortunately, the API doesn't allow to tell a remote repo and the local repo apart...
  return "local".equals( repository.getId() );
}
origin: apache/maven

String getMetadataKey( ArtifactRepository repository, File file )
{
  return repository.getId() + '.' + file.getName() + LAST_UPDATE_TAG;
}
origin: apache/maven

public Set<String> getRepoIds( List<ArtifactRepository> repositories )
{
  Set<String> repoIds = new HashSet<>();
  if ( repositories != null )
  {
    for ( ArtifactRepository repository : repositories )
    {
      repoIds.add( repository.getId() );
    }
  }
  return repoIds;
}
origin: apache/maven

@Override
public MavenExecutionRequest addRemoteRepository( ArtifactRepository repository )
{
  for ( ArtifactRepository repo : getRemoteRepositories() )
  {
    if ( repo.getId() != null && repo.getId().equals( repository.getId() ) )
    {
      return this;
    }
  }
  getRemoteRepositories().add( repository );
  return this;
}
origin: apache/maven

@Override
public MavenExecutionRequest addPluginArtifactRepository( ArtifactRepository repository )
{
  for ( ArtifactRepository repo : getPluginArtifactRepositories() )
  {
    if ( repo.getId() != null && repo.getId().equals( repository.getId() ) )
    {
      return this;
    }
  }
  getPluginArtifactRepositories().add( repository );
  return this;
}
origin: apache/maven

private List<ArtifactRepository> aggregateRepositories( List<ArtifactRepository> requestRepositories,
                            List<ArtifactRepository> pomRepositories )
{
  List<ArtifactRepository> repositories = requestRepositories;
  if ( pomRepositories != null && !pomRepositories.isEmpty() )
  {
    Map<String, ArtifactRepository> repos = new LinkedHashMap<>();
    for ( ArtifactRepository repo : requestRepositories )
    {
      if ( !repos.containsKey( repo.getId() ) )
      {
        repos.put( repo.getId(), repo );
      }
    }
    for ( ArtifactRepository repo : pomRepositories )
    {
      if ( !repos.containsKey( repo.getId() ) )
      {
        repos.put( repo.getId(), repo );
      }
    }
    repositories = new ArrayList<>( repos.values() );
  }
  return repositories;
}
origin: apache/maven

public boolean equals( Object obj )
{
  if ( this == obj )
  {
    return true;
  }
  if ( obj == null )
  {
    return false;
  }
  if ( getClass() != obj.getClass() )
  {
    return false;
  }
  ArtifactRepository other = (ArtifactRepository) obj;
  return eq( getId(), other.getId() );
}
origin: apache/maven

private LegacyLocalRepositoryManager( ArtifactRepository delegate )
{
  this.delegate = Objects.requireNonNull( delegate, "delegate cannot be null" );
  ArtifactRepositoryLayout layout = delegate.getLayout();
  repo =
    new LocalRepository( new File( delegate.getBasedir() ),
               ( layout != null ) ? layout.getClass().getSimpleName() : "legacy" );
  /*
   * NOTE: "invoker:install" vs "appassembler:assemble": Both mojos use the artifact installer to put an artifact
   * into a repository. In the first case, the result needs to be a proper local repository that one can use for
   * local artifact resolution. In the second case, the result needs to precisely obey the path information of the
   * repository's layout to allow pointing at artifacts within the repository. Unfortunately,
   * DefaultRepositoryLayout does not correctly describe the layout of a local repository which unlike a remote
   * repository never uses timestamps in the filename of a snapshot artifact. The discrepancy gets notable when a
   * remotely resolved snapshot artifact gets passed into pathOf(). So producing a proper local artifact path
   * using DefaultRepositoryLayout requires us to enforce usage of the artifact's base version. This
   * transformation however contradicts the other use case of precisely obeying the repository's layout. The below
   * flag tries to detect which use case applies to make both plugins happy.
   */
  realLocalRepo = ( layout instanceof DefaultRepositoryLayout ) && "local".equals( delegate.getId() );
}
origin: apache/maven

private static boolean repositoryEquals( ArtifactRepository r1, ArtifactRepository r2 )
{
  if ( r1 == r2 )
  {
    return true;
  }
  return eq( r1.getId(), r2.getId() ) && eq( r1.getUrl(), r2.getUrl() )
    && repositoryPolicyEquals( r1.getReleases(), r2.getReleases() )
    && repositoryPolicyEquals( r1.getSnapshots(), r2.getSnapshots() );
}
origin: apache/maven

public Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors )
{
  String repoId = repository.getId();
  if ( repoId != null && mirrors != null )
  {
    for ( Mirror mirror : mirrors )
    {
      if ( repoId.equals( mirror.getMirrorOf() ) && matchesLayout( repository, mirror ) )
      {
        return mirror;
      }
    }
    for ( Mirror mirror : mirrors )
    {
      if ( matchPattern( repository, mirror.getMirrorOf() ) && matchesLayout( repository, mirror ) )
      {
        return mirror;
      }
    }
  }
  return null;
}
origin: apache/maven

public static Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors )
{
  String repoId = repository.getId();
  if ( repoId != null && mirrors != null )
  {
    for ( Mirror mirror : mirrors )
    {
      if ( repoId.equals( mirror.getMirrorOf() ) && matchesLayout( repository, mirror ) )
      {
        return mirror;
      }
    }
    for ( Mirror mirror : mirrors )
    {
      if ( matchPattern( repository, mirror.getMirrorOf() ) && matchesLayout( repository, mirror ) )
      {
        return mirror;
      }
    }
  }
  return null;
}
origin: apache/maven

public void resolveAlways( RepositoryMetadata metadata, ArtifactRepository localRepository,
              ArtifactRepository remoteRepository )
  throws RepositoryMetadataResolutionException
{
  File file;
  try
  {
    file = getArtifactMetadataFromDeploymentRepository( metadata, localRepository, remoteRepository );
  }
  catch ( TransferFailedException e )
  {
    throw new RepositoryMetadataResolutionException(
      metadata + " could not be retrieved from repository: " + remoteRepository.getId() + " due to an error: "
        + e.getMessage(), e );
  }
  try
  {
    if ( file.exists() )
    {
      Metadata prevMetadata = readMetadata( file );
      metadata.setMetadata( prevMetadata );
    }
  }
  catch ( RepositoryMetadataReadException e )
  {
    throw new RepositoryMetadataResolutionException( e.getMessage(), e );
  }
}
origin: apache/maven

private void injectMirror( ArtifactRepository repository, Mirror mirror )
{
  if ( mirror != null )
  {
    ArtifactRepository original =
      createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(),
                   repository.getSnapshots(), repository.getReleases() );
    repository.setMirroredRepositories( Collections.singletonList( original ) );
    repository.setId( mirror.getId() );
    repository.setUrl( mirror.getUrl() );
    if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
    {
      repository.setLayout( getLayout( mirror.getLayout() ) );
    }
  }
}
origin: apache/maven

private void injectMirror( ArtifactRepository repository, Mirror mirror )
{
  if ( mirror != null )
  {
    ArtifactRepository original =
      createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(),
                   repository.getSnapshots(), repository.getReleases() );
    repository.setMirroredRepositories( Collections.singletonList( original ) );
    repository.setId( mirror.getId() );
    repository.setUrl( mirror.getUrl() );
    if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
    {
      repository.setLayout( getLayout( mirror.getLayout() ) );
    }
  }
}
origin: apache/maven

@Deprecated
public ArtifactRepository getMirrorRepository( ArtifactRepository repository )
{
  Mirror mirror = mirrorSelector.getMirror( repository, legacySupport.getSession().getSettings().getMirrors() );
  if ( mirror != null )
  {
    String id = mirror.getId();
    if ( id == null )
    {
      // TODO this should be illegal in settings.xml
      id = repository.getId();
    }
    log.debug( "Using mirror: " + mirror.getUrl() + " (id: " + id + ")" );
    repository = artifactRepositoryFactory.createArtifactRepository( id, mirror.getUrl(),
                                 repository.getLayout(), repository.getSnapshots(),
                                 repository.getReleases() );
  }
  return repository;
}
origin: apache/maven

private int resolveLatestSnapshotBuildNumber( Artifact artifact, ArtifactRepository localRepository,
                       ArtifactRepository remoteRepository )
  throws RepositoryMetadataResolutionException
{
  RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact );
  getLogger().info( "Retrieving previous build number from " + remoteRepository.getId() );
  repositoryMetadataManager.resolveAlways( metadata, localRepository, remoteRepository );
  int buildNumber = 0;
  Metadata repoMetadata = metadata.getMetadata();
  if ( ( repoMetadata != null )
    && ( repoMetadata.getVersioning() != null && repoMetadata.getVersioning().getSnapshot() != null ) )
  {
    buildNumber = repoMetadata.getVersioning().getSnapshot().getBuildNumber();
  }
  return buildNumber;
}
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;
}
org.apache.maven.artifact.repositoryArtifactRepositorygetId

Popular methods of ArtifactRepository

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • JList (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • From CI to AI: The AI layer in your organization
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