@Override public void addRepository(Repository repository, boolean replace) throws InvalidRepositoryException { String id = repository.getId(); if (repositoryKeys.contains(id)) { if (!replace) { return; } Iterators.removeIf(repositories.iterator(), input -> input.getId().equals(id)); } List<RemoteRepository> additions = Collections.singletonList( ArtifactDescriptorUtils.toRemoteRepository(repository)); repositories = remoteRepositoryManager.aggregateRepositories(repositorySystemSession, repositories, additions, true); repositoryKeys.add(id); }
@Override public void addRepository(final Repository repository, boolean replace) throws InvalidRepositoryException { if (session.isIgnoreArtifactDescriptorRepositories()) { return; } if (!repositoryIds.add(repository.getId())) { if (!replace) { return; } removeMatchingRepository(repository.getId()); } repositories.add(new RemoteRepository.Builder(repository.getId(), repository.getName(), repository.getUrl()) .build()); }
public void addRepository( Repository repository ) throws InvalidRepositoryException { if ( !repositoryIds.add( repository.getId() ) ) { return; } List<RemoteRepository> newRepositories = Collections.singletonList( ArtifactDescriptorUtils.toRemoteRepository( repository ) ); if ( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT.equals( repositoryMerging ) ) { repositories = remoteRepositoryManager.aggregateRepositories( session, repositories, newRepositories, true ); } else { pomRepositories = remoteRepositoryManager.aggregateRepositories( session, pomRepositories, newRepositories, true ); repositories = remoteRepositoryManager.aggregateRepositories( session, pomRepositories, externalRepositories, false ); } }
private void configureResolver( ModelResolver modelResolver, Model model, DefaultModelProblemCollector problems ) { if ( modelResolver == null ) { return; } problems.setSource( model ); List<Repository> repositories = model.getRepositories(); for ( Repository repository : repositories ) { try { modelResolver.addRepository( repository ); } catch ( InvalidRepositoryException e ) { problems.add( new ModelProblemCollectorRequest(Severity.ERROR, Version.BASE) .setMessage( "Invalid repository " + repository.getId() + ": " + e.getMessage()) .setLocation(repository.getLocation( "" )) .setException(e) ); } } }
@Override public void addRepository(Repository repository, boolean replace) throws InvalidRepositoryException { RepositorySystem repositorySystem = embedder.lookupComponent(RepositorySystem.class); try { ArtifactRepository repo = repositorySystem.buildArtifactRepository(repository); if(replace) { remoteRepositories.remove(repo); } remoteRepositories.add(repo); remoteRepositories = repositorySystem.getEffectiveRepositories( remoteRepositories ); } catch (org.apache.maven.artifact.InvalidRepositoryException ex) { throw new InvalidRepositoryException(ex.toString(), repository, ex); } }
@Override public void addRepository(org.apache.maven.model.Repository repository) throws InvalidRepositoryException { if (!repositoryIds.add(repository.getId())) { return; } this.repositories.add(ArtifactDescriptorUtils.toRemoteRepository(repository)); }
@Override public void addRepository( Repository repository ) throws InvalidRepositoryException { // we just ignore repositories outside of the current one for now // TODO: it'd be nice to look them up from Archiva's set, but we want to do that by URL / mapping, not just the // ID since they will rarely match }
@Override public void addRepository(Repository repository) throws InvalidRepositoryException { if (repositoryIds.contains(repository.getId())) { return; } repositoryIds.add(repository.getId()); repositories.add(new RemoteRepository.Builder(repository.getId(), repository.getName(), repository.getUrl()) .build()); }
public void addRepository( Repository repository ) throws InvalidRepositoryException { if ( !repositoryIds.add( repository.getId() ) ) { return; } List<RemoteRepository> newRepositories = Collections.singletonList( ArtifactDescriptorUtils.toRemoteRepository( repository ) ); this.repositories = remoteRepositoryManager.aggregateRepositories( session, repositories, newRepositories, true ); }
@Override public void addRepository(Repository repository) throws InvalidRepositoryException { addRepository(repository, false); }
@Override public void addRepository(org.apache.maven.model.Repository repository, boolean replace) throws InvalidRepositoryException { // TODO Auto-generated method stub }
@Override public void addRepository(Repository repository) throws InvalidRepositoryException {}
@Override public void addRepository(Repository repository, boolean replace) throws InvalidRepositoryException {}
@Override public void addRepository(Repository repository) throws InvalidRepositoryException { }
@Override public void addRepository(Repository repository) throws InvalidRepositoryException { RemoteRepository remote = new RemoteRepository(repository.getId(), repository.getLayout(), repository.getUrl()); repos.add(remote); }
@Override public void addRepository(Repository repository) throws InvalidRepositoryException { // noop }