maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject [11/50] git commit: Accounted for refactoring of aether-api
Date Mon, 18 Mar 2013 21:47:28 GMT
Accounted for refactoring of aether-api


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/42536ce8
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/42536ce8
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/42536ce8

Branch: refs/heads/master
Commit: 42536ce88f252c032f1d73c3cbd0ec22f7c946cd
Parents: 2838745
Author: Benjamin Bentmann <bentmann@apache.org>
Authored: Sun Sep 30 17:37:09 2012 +0200
Committer: Benjamin Bentmann <bentmann@apache.org>
Committed: Sun Sep 30 17:37:09 2012 +0200

----------------------------------------------------------------------
 .../internal/ArtifactDescriptorUtils.java          |   10 +++---
 .../artifact/deployer/DefaultArtifactDeployer.java |    6 +++-
 .../main/java/org/apache/maven/DefaultMaven.java   |    6 ++--
 .../java/org/apache/maven/RepositoryUtils.java     |   20 ++++++++------
 4 files changed, 23 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/42536ce8/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java
----------------------------------------------------------------------
diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java
b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java
index c4def8a..8515803 100644
--- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java
+++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java
@@ -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 )

http://git-wip-us.apache.org/repos/asf/maven/blob/42536ce8/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
----------------------------------------------------------------------
diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
b/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
index 5905e08..abbab82 100644
--- a/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
+++ b/maven-compat/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
@@ -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 );
 

http://git-wip-us.apache.org/repos/asf/maven/blob/42536ce8/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index b6f3f49..0e2ca64 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -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 )

http://git-wip-us.apache.org/repos/asf/maven/blob/42536ce8/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java
index f07a377..9b68a2e 100644
--- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java
+++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java
@@ -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;


Mime
View raw message