builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( remoteRepo ) ); builder.setProxy( session.getProxySelector().getProxy( remoteRepo ) ); remoteRepo = builder.build();
private Authentication getAuthentication( RepositorySystemSession session, ArtifactRepository repository ) { if ( session != null ) { AuthenticationSelector selector = session.getAuthenticationSelector(); if ( selector != null ) { RemoteRepository repo = RepositoryUtils.toRepo( repository ); org.eclipse.aether.repository.Authentication auth = selector.getAuthentication( repo ); if ( auth != null ) { repo = new RemoteRepository.Builder( repo ).setAuthentication( auth ).build(); AuthenticationContext authCtx = AuthenticationContext.forRepository( session, repo ); Authentication result = new Authentication( authCtx.get( AuthenticationContext.USERNAME ), authCtx.get( AuthenticationContext.PASSWORD ) ); result.setPrivateKey( authCtx.get( AuthenticationContext.PRIVATE_KEY_PATH ) ); result.setPassphrase( authCtx.get( AuthenticationContext.PRIVATE_KEY_PASSPHRASE ) ); authCtx.close(); return result; } } } return null; }
private Authentication getAuthentication( RepositorySystemSession session, ArtifactRepository repository ) { if ( session != null ) { AuthenticationSelector selector = session.getAuthenticationSelector(); if ( selector != null ) { RemoteRepository repo = RepositoryUtils.toRepo( repository ); org.eclipse.aether.repository.Authentication auth = selector.getAuthentication( repo ); if ( auth != null ) { repo = new RemoteRepository.Builder( repo ).setAuthentication( auth ).build(); AuthenticationContext authCtx = AuthenticationContext.forRepository( session, repo ); Authentication result = new Authentication( authCtx.get( AuthenticationContext.USERNAME ), authCtx.get( AuthenticationContext.PASSWORD ) ); result.setPrivateKey( authCtx.get( AuthenticationContext.PRIVATE_KEY_PATH ) ); result.setPassphrase( authCtx.get( AuthenticationContext.PRIVATE_KEY_PASSPHRASE ) ); authCtx.close(); return result; } } } return null; }
private RemoteRepository setAuthentication(RemoteRepository remoteRepository) { RemoteRepository.Builder authenticated = new RemoteRepository.Builder(remoteRepository); this.resolutionContext.getAuthenticatorSelector() .ifPresent(authSelector -> authenticated.setAuthentication(authSelector.getAuthentication(remoteRepository))); return authenticated.build(); }
public Authentication getAuthentication( RemoteRepository repository ) { Authentication auth = repository.getAuthentication(); if ( auth != null ) { return auth; } return selector.getAuthentication( repository ); }
public Authentication getAuthentication( RemoteRepository repository ) { Authentication auth = repository.getAuthentication(); if ( auth != null ) { return auth; } return selector.getAuthentication( repository ); }
private RemoteRepository setAuthentication(RemoteRepository remoteRepository) { RemoteRepository.Builder authenticated = new RemoteRepository.Builder(remoteRepository); this.resolutionContext.getAuthenticatorSelector() .ifPresent(authSelector -> authenticated.setAuthentication(authSelector.getAuthentication(remoteRepository))); return authenticated.build(); }
private RemoteRepository applyAuthentication(RemoteRepository repository) { if (repository.getAuthentication() == null) { RemoteRepository.Builder builder = new RemoteRepository.Builder(repository); builder.setAuthentication(this.session.getAuthenticationSelector() .getAuthentication(repository)); repository = builder.build(); } return repository; }
Authentication auth = authSelector.getAuthentication( repository ); if ( auth != null )
Authentication auth = authSelector.getAuthentication( repository ); if ( auth != null )
public RemoteRepository newDeploymentRepository( RepositorySystemSession session, RemoteRepository repository ) { validateSession( session ); RemoteRepository.Builder builder = new RemoteRepository.Builder( repository ); Authentication auth = session.getAuthenticationSelector().getAuthentication( repository ); builder.setAuthentication( auth ); Proxy proxy = session.getProxySelector().getProxy( repository ); builder.setProxy( proxy ); return builder.build(); }
public RemoteRepository newDeploymentRepository( RepositorySystemSession session, RemoteRepository repository ) { validateSession( session ); RemoteRepository.Builder builder = new RemoteRepository.Builder( repository ); Authentication auth = session.getAuthenticationSelector().getAuthentication( repository ); builder.setAuthentication( auth ); Proxy proxy = session.getProxySelector().getProxy( repository ); builder.setProxy( proxy ); return builder.build(); }
private RemoteRepository getRemoteRepository( RepositorySystemSession session, ArtifactRepository remoteRepository ) throws ArtifactDeployerException { // CHECKSTYLE_OFF: LineLength RemoteRepository aetherRepo = (RemoteRepository) Invoker.invoke( RepositoryUtils.class, "toRepo", org.apache.maven.artifact.repository.ArtifactRepository.class, remoteRepository ); // CHECKSTYLE_ON: LineLength if ( aetherRepo.getAuthentication() == null || aetherRepo.getProxy() == null ) { RemoteRepository.Builder builder = new RemoteRepository.Builder( aetherRepo ); if ( aetherRepo.getAuthentication() == null ) { builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( aetherRepo ) ); } if ( aetherRepo.getProxy() == null ) { builder.setProxy( session.getProxySelector().getProxy( aetherRepo ) ); } aetherRepo = builder.build(); } return aetherRepo; } }
Authentication authentication = embedder.getMavenSession().getRepositorySession() .getAuthenticationSelector() .getAuthentication( remoteRepoBuilder.build() ); remoteRepoBuilder.setAuthentication( authentication ); } finally {
Authentication authentication = embedder.getMavenSession().getRepositorySession() .getAuthenticationSelector() .getAuthentication( remoteRepoBuilder.build() ); remoteRepoBuilder.setAuthentication( authentication ); } finally {
private RemoteRepository getRemoteRepoFromDeployment(final DeploymentRepository repo, final MavenEmbedder embedder) { RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(repo.getId(), repo.getLayout(), repo .getUrl()) .setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)) .setReleasePolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_WARN)); Settings settings = MavenSettings.getSettings(); Server server = settings.getServer(repo.getId()); if (server != null) { Authentication authentication = embedder.getMavenSession().getRepositorySession() .getAuthenticationSelector() .getAuthentication(remoteRepoBuilder.build()); remoteRepoBuilder.setAuthentication(authentication); } return remoteRepoBuilder.build(); }
private RemoteRepository getRemoteRepoFromDeployment(final DeploymentRepository repo, final MavenEmbedder embedder) { RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(repo.getId(), repo.getLayout(), repo .getUrl()) .setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)) .setReleasePolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_WARN)); Settings settings = MavenSettings.getSettings(); Server server = settings.getServer(repo.getId()); if (server != null) { Authentication authentication = embedder.getMavenSession().getRepositorySession() .getAuthenticationSelector() .getAuthentication(remoteRepoBuilder.build()); remoteRepoBuilder.setAuthentication(authentication); } return remoteRepoBuilder.build(); }
private RemoteRepository getRemoteRepoFromDeployment(final DeploymentRepository repo, final MavenEmbedder embedder) { RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(repo.getId(), repo.getLayout(), repo .getUrl()) .setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)) .setReleasePolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_WARN)); Settings settings = MavenSettings.getSettings(); Server server = settings.getServer(repo.getId()); if (server != null) { Authentication authentication = embedder.getMavenSession().getRepositorySession() .getAuthenticationSelector() .getAuthentication(remoteRepoBuilder.build()); remoteRepoBuilder.setAuthentication(authentication); } return remoteRepoBuilder.build(); }
private RemoteRepository convertToArtifactRepository(final org.apache.maven.artifact.repository.ArtifactRepository artifactRepository) { final MavenEmbedder mavenEmbedder = MavenProjectLoader.newMavenEmbedder(MavenSettings.getSettings().isOffline()); final RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(artifactRepository.getId(), artifactRepository.getLayout().getId(), artifactRepository.getUrl()) .setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)) .setReleasePolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_WARN)); final Settings settings = MavenSettings.getSettings(); final Server server = settings.getServer(artifactRepository.getId()); if (server != null) { final Authentication authentication = mavenEmbedder .getMavenSession() .getRepositorySession() .getAuthenticationSelector() .getAuthentication(remoteRepoBuilder.build()); remoteRepoBuilder.setAuthentication(authentication); } return remoteRepoBuilder.build(); } }
private RemoteRepository convertToArtifactRepository(final org.apache.maven.artifact.repository.ArtifactRepository artifactRepository) { final MavenEmbedder mavenEmbedder = MavenProjectLoader.newMavenEmbedder(MavenSettings.getSettings().isOffline()); final RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(artifactRepository.getId(), artifactRepository.getLayout().getId(), artifactRepository.getUrl()) .setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)) .setReleasePolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_WARN)); final Settings settings = MavenSettings.getSettings(); final Server server = settings.getServer(artifactRepository.getId()); if (server != null) { final Authentication authentication = mavenEmbedder .getMavenSession() .getRepositorySession() .getAuthenticationSelector() .getAuthentication(remoteRepoBuilder.build()); remoteRepoBuilder.setAuthentication(authentication); } return remoteRepoBuilder.build(); } }