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; }
@Override public AuthenticationSelector getAuthenticationSelector() { return delegate.getAuthenticationSelector(); }
@Override public AuthenticationSelector getAuthenticationSelector() { return delegate.getAuthenticationSelector(); }
@Override public AuthenticationSelector getAuthenticationSelector() { return delegate.getAuthenticationSelector(); }
@Override public AuthenticationSelector getAuthenticationSelector() { return delegate.getAuthenticationSelector(); }
@Override public AuthenticationSelector getAuthenticationSelector() { return getSession().getAuthenticationSelector(); }
public AuthenticationSelector getAuthenticationSelector() { return getSession().getAuthenticationSelector(); }
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 void validateSession( RepositorySystemSession session ) { requireNonNull( session, "repository system session cannot be null" ); invalidSession( session.getLocalRepositoryManager(), "local repository manager" ); invalidSession( session.getSystemProperties(), "system properties" ); invalidSession( session.getUserProperties(), "user properties" ); invalidSession( session.getConfigProperties(), "config properties" ); invalidSession( session.getMirrorSelector(), "mirror selector" ); invalidSession( session.getProxySelector(), "proxy selector" ); invalidSession( session.getAuthenticationSelector(), "authentication selector" ); invalidSession( session.getArtifactTypeRegistry(), "artifact type registry" ); invalidSession( session.getData(), "data" ); }
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(); } }
private static RemoteRepository getRemoteRepoFromDeployment(final DeploymentRepository deploymentRepository, final RepositorySystemSession mavenSession) { final RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(deploymentRepository.getId(), deploymentRepository.getLayout(), deploymentRepository.getUrl()) .setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)) .setReleasePolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)); final Settings settings = MavenSettings.getSettings(); final Server server = settings.getServer(deploymentRepository.getId()); if (server != null) { final Authentication authentication = mavenSession .getAuthenticationSelector() .getAuthentication(remoteRepoBuilder.build()); remoteRepoBuilder.setAuthentication(authentication); } return remoteRepoBuilder.build(); }
private static RemoteRepository getRemoteRepoFromDeployment(final DeploymentRepository deploymentRepository, final RepositorySystemSession mavenSession) { final RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(deploymentRepository.getId(), deploymentRepository.getLayout(), deploymentRepository.getUrl()) .setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)) .setReleasePolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)); final Settings settings = MavenSettings.getSettings(); final Server server = settings.getServer(deploymentRepository.getId()); if (server != null) { final Authentication authentication = mavenSession .getAuthenticationSelector() .getAuthentication(remoteRepoBuilder.build()); remoteRepoBuilder.setAuthentication(authentication); } return remoteRepoBuilder.build(); }
private static RemoteRepository getRemoteRepoFromDeployment(final DeploymentRepository deploymentRepository, final RepositorySystemSession mavenSession) { final RemoteRepository.Builder remoteRepoBuilder = new RemoteRepository.Builder(deploymentRepository.getId(), deploymentRepository.getLayout(), deploymentRepository.getUrl()) .setSnapshotPolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)) .setReleasePolicy(new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN)); final Settings settings = MavenSettings.getSettings(); final Server server = settings.getServer(deploymentRepository.getId()); if (server != null) { final Authentication authentication = mavenSession .getAuthenticationSelector() .getAuthentication(remoteRepoBuilder.build()); remoteRepoBuilder.setAuthentication(authentication); } return remoteRepoBuilder.build(); }