mirror of https://github.com/apache/maven.git
Accounted for refactoring of aether-api
This commit is contained in:
parent
2838745156
commit
42536ce88f
|
@ -49,11 +49,11 @@ public class ArtifactDescriptorUtils
|
||||||
|
|
||||||
public static RemoteRepository toRemoteRepository( Repository repository )
|
public static RemoteRepository toRemoteRepository( Repository repository )
|
||||||
{
|
{
|
||||||
RemoteRepository result =
|
RemoteRepository.Builder builder =
|
||||||
new RemoteRepository( repository.getId(), repository.getLayout(), repository.getUrl() );
|
new RemoteRepository.Builder( repository.getId(), repository.getLayout(), repository.getUrl() );
|
||||||
result.setPolicy( true, toRepositoryPolicy( repository.getSnapshots() ) );
|
builder.setSnapshotPolicy( toRepositoryPolicy( repository.getSnapshots() ) );
|
||||||
result.setPolicy( false, toRepositoryPolicy( repository.getReleases() ) );
|
builder.setReleasePolicy( toRepositoryPolicy( repository.getReleases() ) );
|
||||||
return result;
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RepositoryPolicy toRepositoryPolicy( org.apache.maven.model.RepositoryPolicy policy )
|
public static RepositoryPolicy toRepositoryPolicy( org.apache.maven.model.RepositoryPolicy policy )
|
||||||
|
|
|
@ -126,8 +126,10 @@ public class DefaultArtifactDeployer
|
||||||
if ( deploymentRepository instanceof DefaultArtifactRepository
|
if ( deploymentRepository instanceof DefaultArtifactRepository
|
||||||
&& deploymentRepository.getAuthentication() == null )
|
&& deploymentRepository.getAuthentication() == null )
|
||||||
{
|
{
|
||||||
remoteRepo.setAuthentication( session.getAuthenticationSelector().getAuthentication( remoteRepo ) );
|
RemoteRepository.Builder builder = new RemoteRepository.Builder( remoteRepo );
|
||||||
remoteRepo.setProxy( session.getProxySelector().getProxy( remoteRepo ) );
|
builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( remoteRepo ) );
|
||||||
|
builder.setProxy( session.getProxySelector().getProxy( remoteRepo ) );
|
||||||
|
remoteRepo = builder.build();
|
||||||
}
|
}
|
||||||
request.setRepository( remoteRepo );
|
request.setRepository( remoteRepo );
|
||||||
|
|
||||||
|
|
|
@ -408,7 +408,7 @@ public class DefaultMaven
|
||||||
for ( Proxy proxy : decrypted.getProxies() )
|
for ( Proxy proxy : decrypted.getProxies() )
|
||||||
{
|
{
|
||||||
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
|
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(),
|
proxySelector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(),
|
||||||
proxy.getPort(), authBuilder.build() ),
|
proxy.getPort(), authBuilder.build() ),
|
||||||
proxy.getNonProxyHosts() );
|
proxy.getNonProxyHosts() );
|
||||||
|
@ -419,8 +419,8 @@ public class DefaultMaven
|
||||||
for ( Server server : decrypted.getServers() )
|
for ( Server server : decrypted.getServers() )
|
||||||
{
|
{
|
||||||
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
|
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
|
||||||
authBuilder.username( server.getUsername() ).password( server.getPassword() );
|
authBuilder.addUsername( server.getUsername() ).addPassword( server.getPassword() );
|
||||||
authBuilder.privateKey( server.getPrivateKey(), server.getPassphrase() );
|
authBuilder.addPrivateKey( server.getPrivateKey(), server.getPassphrase() );
|
||||||
authSelector.add( server.getId(), authBuilder.build() );
|
authSelector.add( server.getId(), authBuilder.build() );
|
||||||
|
|
||||||
if ( server.getConfiguration() != null )
|
if ( server.getConfiguration() != null )
|
||||||
|
|
|
@ -198,12 +198,14 @@ public class RepositoryUtils
|
||||||
RemoteRepository result = null;
|
RemoteRepository result = null;
|
||||||
if ( repo != null )
|
if ( repo != null )
|
||||||
{
|
{
|
||||||
result = new RemoteRepository( repo.getId(), getLayout( repo ), repo.getUrl() );
|
RemoteRepository.Builder builder =
|
||||||
result.setPolicy( true, toPolicy( repo.getSnapshots() ) );
|
new RemoteRepository.Builder( repo.getId(), getLayout( repo ), repo.getUrl() );
|
||||||
result.setPolicy( false, toPolicy( repo.getReleases() ) );
|
builder.setSnapshotPolicy( toPolicy( repo.getSnapshots() ) );
|
||||||
result.setAuthentication( toAuthentication( repo.getAuthentication() ) );
|
builder.setReleasePolicy( toPolicy( repo.getReleases() ) );
|
||||||
result.setProxy( toProxy( repo.getProxy() ) );
|
builder.setAuthentication( toAuthentication( repo.getAuthentication() ) );
|
||||||
result.setMirroredRepositories( toRepos( repo.getMirroredRepositories() ) );
|
builder.setProxy( toProxy( repo.getProxy() ) );
|
||||||
|
builder.setMirroredRepositories( toRepos( repo.getMirroredRepositories() ) );
|
||||||
|
result = builder.build();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -249,8 +251,8 @@ public class RepositoryUtils
|
||||||
if ( auth != null )
|
if ( auth != null )
|
||||||
{
|
{
|
||||||
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
|
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
|
||||||
authBuilder.username( auth.getUsername() ).password( auth.getPassword() );
|
authBuilder.addUsername( auth.getUsername() ).addPassword( auth.getPassword() );
|
||||||
authBuilder.privateKey( auth.getPrivateKey(), auth.getPassphrase() );
|
authBuilder.addPrivateKey( auth.getPrivateKey(), auth.getPassphrase() );
|
||||||
result = authBuilder.build();
|
result = authBuilder.build();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -262,7 +264,7 @@ public class RepositoryUtils
|
||||||
if ( proxy != null )
|
if ( proxy != null )
|
||||||
{
|
{
|
||||||
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
|
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() );
|
result = new Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), authBuilder.build() );
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue