Accounted for refactoring of aether-api

This commit is contained in:
Benjamin Bentmann 2012-09-30 17:37:09 +02:00
parent 2838745156
commit 42536ce88f
4 changed files with 23 additions and 19 deletions

View File

@ -49,11 +49,11 @@ public class ArtifactDescriptorUtils
public static RemoteRepository toRemoteRepository( Repository repository )
{
RemoteRepository result =
new RemoteRepository( repository.getId(), repository.getLayout(), repository.getUrl() );
result.setPolicy( true, toRepositoryPolicy( repository.getSnapshots() ) );
result.setPolicy( false, toRepositoryPolicy( repository.getReleases() ) );
return result;
RemoteRepository.Builder builder =
new RemoteRepository.Builder( repository.getId(), repository.getLayout(), repository.getUrl() );
builder.setSnapshotPolicy( toRepositoryPolicy( repository.getSnapshots() ) );
builder.setReleasePolicy( toRepositoryPolicy( repository.getReleases() ) );
return builder.build();
}
public static RepositoryPolicy toRepositoryPolicy( org.apache.maven.model.RepositoryPolicy policy )

View File

@ -126,8 +126,10 @@ public class DefaultArtifactDeployer
if ( deploymentRepository instanceof DefaultArtifactRepository
&& deploymentRepository.getAuthentication() == null )
{
remoteRepo.setAuthentication( session.getAuthenticationSelector().getAuthentication( remoteRepo ) );
remoteRepo.setProxy( session.getProxySelector().getProxy( remoteRepo ) );
RemoteRepository.Builder builder = new RemoteRepository.Builder( remoteRepo );
builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( remoteRepo ) );
builder.setProxy( session.getProxySelector().getProxy( remoteRepo ) );
remoteRepo = builder.build();
}
request.setRepository( remoteRepo );

View File

@ -408,7 +408,7 @@ public class DefaultMaven
for ( Proxy proxy : decrypted.getProxies() )
{
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
authBuilder.username( proxy.getUsername() ).password( proxy.getPassword() );
authBuilder.addUsername( proxy.getUsername() ).addPassword( proxy.getPassword() );
proxySelector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(),
proxy.getPort(), authBuilder.build() ),
proxy.getNonProxyHosts() );
@ -419,8 +419,8 @@ public class DefaultMaven
for ( Server server : decrypted.getServers() )
{
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
authBuilder.username( server.getUsername() ).password( server.getPassword() );
authBuilder.privateKey( server.getPrivateKey(), server.getPassphrase() );
authBuilder.addUsername( server.getUsername() ).addPassword( server.getPassword() );
authBuilder.addPrivateKey( server.getPrivateKey(), server.getPassphrase() );
authSelector.add( server.getId(), authBuilder.build() );
if ( server.getConfiguration() != null )

View File

@ -198,12 +198,14 @@ public class RepositoryUtils
RemoteRepository result = null;
if ( repo != null )
{
result = new RemoteRepository( repo.getId(), getLayout( repo ), repo.getUrl() );
result.setPolicy( true, toPolicy( repo.getSnapshots() ) );
result.setPolicy( false, toPolicy( repo.getReleases() ) );
result.setAuthentication( toAuthentication( repo.getAuthentication() ) );
result.setProxy( toProxy( repo.getProxy() ) );
result.setMirroredRepositories( toRepos( repo.getMirroredRepositories() ) );
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;
}
@ -249,8 +251,8 @@ public class RepositoryUtils
if ( auth != null )
{
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
authBuilder.username( auth.getUsername() ).password( auth.getPassword() );
authBuilder.privateKey( auth.getPrivateKey(), auth.getPassphrase() );
authBuilder.addUsername( auth.getUsername() ).addPassword( auth.getPassword() );
authBuilder.addPrivateKey( auth.getPrivateKey(), auth.getPassphrase() );
result = authBuilder.build();
}
return result;
@ -262,7 +264,7 @@ public class RepositoryUtils
if ( proxy != null )
{
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
authBuilder.username( proxy.getUserName() ).password( proxy.getPassword() );
authBuilder.addUsername( proxy.getUserName() ).addPassword( proxy.getPassword() );
result = new Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), authBuilder.build() );
}
return result;