maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r995585 - in /maven/maven-3/trunk: maven-compat/src/main/java/org/apache/maven/project/ maven-core/src/main/java/org/apache/maven/execution/ maven-core/src/main/java/org/apache/maven/project/ maven-core/src/main/java/org/apache/maven/projec...
Date Thu, 09 Sep 2010 21:52:51 GMT
Author: bentmann
Date: Thu Sep  9 21:52:50 2010
New Revision: 995585

URL: http://svn.apache.org/viewvc?rev=995585&view=rev
Log:
o Cleaned up code

Modified:
    maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java

Modified: maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=995585&r1=995584&r2=995585&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Thu Sep  9 21:52:50 2010
@@ -95,7 +95,6 @@ public class DefaultMavenProjectBuilder
         if ( session != null )
         {
             request.setRepositorySession( session.getRepositorySession() );
-            request.setOffline( session.isOffline() );
             request.setSystemProperties( session.getSystemProperties() );
             if ( request.getUserProperties().isEmpty() )
             {
@@ -105,11 +104,7 @@ public class DefaultMavenProjectBuilder
             MavenExecutionRequest req = session.getRequest();
             if ( req != null )
             {
-                request.setServers( req.getServers() );
-                request.setMirrors( req.getMirrors() );
-                request.setProxies( req.getProxies() );
                 request.setRemoteRepositories( req.getRemoteRepositories() );
-                request.setForceUpdate( req.isUpdateSnapshots() );
             }
         }
         else

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java?rev=995585&r1=995584&r2=995585&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
(original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
Thu Sep  9 21:52:50 2010
@@ -958,11 +958,6 @@ public class DefaultMavenExecutionReques
             projectBuildingRequest.setUserProperties( getUserProperties() );
             projectBuildingRequest.setRemoteRepositories( getRemoteRepositories() );
             projectBuildingRequest.setPluginArtifactRepositories( getPluginArtifactRepositories()
);
-            projectBuildingRequest.setOffline( isOffline() );
-            projectBuildingRequest.setForceUpdate( isUpdateSnapshots() );
-            projectBuildingRequest.setServers( getServers() );
-            projectBuildingRequest.setMirrors( getMirrors() );
-            projectBuildingRequest.setProxies( getProxies() );
             projectBuildingRequest.setActiveProfileIds( getActiveProfiles() );
             projectBuildingRequest.setInactiveProfileIds( getInactiveProfiles() );
             projectBuildingRequest.setProfiles( getProfiles() );

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java?rev=995585&r1=995584&r2=995585&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
(original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
Thu Sep  9 21:52:50 2010
@@ -28,9 +28,6 @@ import org.apache.maven.artifact.reposit
 import org.apache.maven.model.Profile;
 import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.repository.ArtifactTransferListener;
-import org.apache.maven.settings.Mirror;
-import org.apache.maven.settings.Proxy;
-import org.apache.maven.settings.Server;
 import org.sonatype.aether.RepositorySystemSession;
 
 public class DefaultProjectBuildingRequest
@@ -39,22 +36,12 @@ public class DefaultProjectBuildingReque
 
     private RepositorySystemSession repositorySession;
 
-    private boolean offline;
-
-    private boolean forceUpdate;
-
     private ArtifactRepository localRepository;
 
     private List<ArtifactRepository> remoteRepositories;
 
     private List<ArtifactRepository> pluginArtifactRepositories;
 
-    private List<Server> servers;
-
-    private List<Mirror> mirrors;
-
-    private List<Proxy> proxies;
-
     private MavenProject project;
 
     private int validationLevel = ModelBuildingRequest.VALIDATION_LEVEL_STRICT;
@@ -87,9 +74,6 @@ public class DefaultProjectBuildingReque
         userProperties = new Properties();
         remoteRepositories = new ArrayList<ArtifactRepository>();
         pluginArtifactRepositories = new ArrayList<ArtifactRepository>();
-        servers = new ArrayList<Server>();
-        mirrors = new ArrayList<Mirror>();
-        proxies = new ArrayList<Proxy>();
     }
 
     public MavenProject getProject()
@@ -102,30 +86,6 @@ public class DefaultProjectBuildingReque
         this.project = mavenProject;
     }
 
-    public DefaultProjectBuildingRequest setOffline( boolean offline )
-    {
-        this.offline = offline;
-
-        return this;
-    }
-
-    public boolean isOffline()
-    {
-        return offline;
-    }
-
-    public boolean isForceUpdate()
-    {
-        return forceUpdate;
-    }
-
-    public ProjectBuildingRequest setForceUpdate( boolean forceUpdate )
-    {
-        this.forceUpdate = forceUpdate;
-
-        return this;
-    }
-
     public ProjectBuildingRequest setLocalRepository( ArtifactRepository localRepository
)
     {
         this.localRepository = localRepository;
@@ -175,63 +135,6 @@ public class DefaultProjectBuildingReque
         return this;
     }
 
-    public ProjectBuildingRequest setServers( List<Server> servers )
-    {
-        if ( servers != null )
-        {
-            this.servers = new ArrayList<Server>( servers );
-        }
-        else
-        {
-            this.servers.clear();
-        }
-
-        return this;
-    }
-
-    public List<Server> getServers()
-    {
-        return servers;
-    }
-
-    public ProjectBuildingRequest setMirrors( List<Mirror> mirrors )
-    {
-        if ( mirrors != null )
-        {
-            this.mirrors = new ArrayList<Mirror>( mirrors );
-        }
-        else
-        {
-            this.mirrors.clear();
-        }
-
-        return this;
-    }
-
-    public List<Mirror> getMirrors()
-    {
-        return mirrors;
-    }
-
-    public ProjectBuildingRequest setProxies( List<Proxy> proxies )
-    {
-        if ( proxies != null )
-        {
-            this.proxies = new ArrayList<Proxy>( proxies );
-        }
-        else
-        {
-            this.proxies.clear();
-        }
-
-        return this;
-    }
-
-    public List<Proxy> getProxies()
-    {
-        return proxies;
-    }
-
     public Properties getSystemProperties()
     {
         return systemProperties;

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java?rev=995585&r1=995584&r2=995585&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
(original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
Thu Sep  9 21:52:50 2010
@@ -26,22 +26,11 @@ import java.util.Properties;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.model.Profile;
 import org.apache.maven.model.building.ModelBuildingRequest;
-import org.apache.maven.settings.Mirror;
-import org.apache.maven.settings.Proxy;
-import org.apache.maven.settings.Server;
 import org.sonatype.aether.RepositorySystemSession;
 
 public interface ProjectBuildingRequest
 {
 
-    ProjectBuildingRequest setOffline( boolean offline );
-
-    boolean isOffline();
-
-    ProjectBuildingRequest setForceUpdate( boolean forceUpdate );
-
-    boolean isForceUpdate();
-
     ProjectBuildingRequest setLocalRepository( ArtifactRepository localRepository );
     
     ArtifactRepository getLocalRepository();
@@ -54,18 +43,6 @@ public interface ProjectBuildingRequest
 
     List<ArtifactRepository> getPluginArtifactRepositories();
 
-    ProjectBuildingRequest setServers( List<Server> servers );
-
-    List<Server> getServers();
-
-    ProjectBuildingRequest setMirrors( List<Mirror> mirrors );
-
-    List<Mirror> getMirrors();
-
-    ProjectBuildingRequest setProxies( List<Proxy> proxies );
-
-    List<Proxy> getProxies();
-
     /**
      * Sets the system properties to use for interpolation and profile activation. The system
properties are collected
      * from the runtime environment like {@link System#getProperties()} and environment variables.

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java?rev=995585&r1=995584&r2=995585&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
(original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
Thu Sep  9 21:52:50 2010
@@ -76,6 +76,8 @@ import org.codehaus.plexus.component.ann
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.logging.Logger;
+import org.sonatype.aether.RepositorySystemSession;
+import org.sonatype.aether.repository.RepositoryPolicy;
 import org.sonatype.aether.transfer.ArtifactNotFoundException;
 
 /**
@@ -109,14 +111,12 @@ public class MavenMetadataSource
 
     private void injectSession( MetadataResolutionRequest request )
     {
-        MavenSession session = legacySupport.getSession();
+        RepositorySystemSession session = legacySupport.getRepositorySession();
 
         if ( session != null )
         {
             request.setOffline( session.isOffline() );
-            request.setServers( session.getRequest().getServers() );
-            request.setMirrors( session.getRequest().getMirrors() );
-            request.setProxies( session.getRequest().getProxies() );
+            request.setForceUpdate( RepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( session.getUpdatePolicy()
) );
         }
     }
 
@@ -571,14 +571,9 @@ public class MavenMetadataSource
                     ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
                     configuration.setLocalRepository( repositoryRequest.getLocalRepository()
);
                     configuration.setRemoteRepositories( repositoryRequest.getRemoteRepositories()
);
-                    configuration.setOffline( repositoryRequest.isOffline() );
-                    configuration.setForceUpdate( repositoryRequest.isForceUpdate() );
                     configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL
);
                     configuration.setProcessPlugins( false );
                     configuration.setSystemProperties( getSystemProperties() );
-                    configuration.setServers( repositoryRequest.getServers() );
-                    configuration.setMirrors( repositoryRequest.getMirrors() );
-                    configuration.setProxies( repositoryRequest.getProxies() );
                     configuration.setRepositorySession( legacySupport.getRepositorySession()
);
 
                     project = getProjectBuilder().build( pomArtifact, configuration ).getProject();

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java?rev=995585&r1=995584&r2=995585&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java
(original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java
Thu Sep  9 21:52:50 2010
@@ -19,7 +19,6 @@ package org.apache.maven.repository.lega
  * under the License.
  */
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.maven.artifact.Artifact;
@@ -27,9 +26,6 @@ import org.apache.maven.artifact.reposit
 import org.apache.maven.artifact.repository.DefaultRepositoryRequest;
 import org.apache.maven.artifact.repository.RepositoryRequest;
 import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
-import org.apache.maven.settings.Mirror;
-import org.apache.maven.settings.Proxy;
-import org.apache.maven.settings.Server;
 
 /**
  * Forms a request to retrieve artifact metadata.
@@ -46,12 +42,6 @@ public class DefaultMetadataResolutionRe
 
     private RepositoryRequest repositoryRequest;
 
-    private List<Server> servers;
-
-    private List<Mirror> mirrors;
-
-    private List<Proxy> proxies;
-
     public DefaultMetadataResolutionRequest()
     {
         repositoryRequest = new DefaultRepositoryRequest();
@@ -65,9 +55,6 @@ public class DefaultMetadataResolutionRe
     public DefaultMetadataResolutionRequest( ArtifactResolutionRequest resolutionRequest
)
     {
         this.repositoryRequest = new DefaultRepositoryRequest( resolutionRequest );
-        setServers( resolutionRequest.getServers() );
-        setMirrors( resolutionRequest.getMirrors() );
-        setProxies( resolutionRequest.getProxies() );
     }
 
     public Artifact getArtifact()
@@ -142,55 +129,4 @@ public class DefaultMetadataResolutionRe
         return this;
     }
 
-    public MetadataResolutionRequest setServers( List<Server> servers )
-    {
-        this.servers = servers;
-
-        return this;
-    }
-
-    public List<Server> getServers()
-    {
-        if ( servers == null )
-        {
-            servers = new ArrayList<Server>();
-        }
-
-        return servers;
-    }
-
-    public MetadataResolutionRequest setMirrors( List<Mirror> mirrors )
-    {
-        this.mirrors = mirrors;
-
-        return this;
-    }
-
-    public List<Mirror> getMirrors()
-    {
-        if ( mirrors == null )
-        {
-            mirrors = new ArrayList<Mirror>();
-        }
-
-        return mirrors;
-    }
-
-    public MetadataResolutionRequest setProxies( List<Proxy> proxies )
-    {
-        this.proxies = proxies;
-
-        return this;
-    }
-
-    public List<Proxy> getProxies()
-    {
-        if ( proxies == null )
-        {
-            proxies = new ArrayList<Proxy>();
-        }
-
-        return proxies;
-    }
-
 }

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java?rev=995585&r1=995584&r2=995585&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java
(original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java
Thu Sep  9 21:52:50 2010
@@ -24,9 +24,6 @@ import java.util.List;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.RepositoryRequest;
-import org.apache.maven.settings.Mirror;
-import org.apache.maven.settings.Proxy;
-import org.apache.maven.settings.Server;
 
 /**
  * Forms a request to retrieve artifact metadata.
@@ -113,16 +110,4 @@ public interface MetadataResolutionReque
      */
     MetadataResolutionRequest setResolveManagedVersions( boolean resolveManagedVersions );
 
-    MetadataResolutionRequest setServers( List<Server> servers );
-
-    List<Server> getServers();
-
-    MetadataResolutionRequest setMirrors( List<Mirror> mirrors );
-
-    List<Mirror> getMirrors();
-
-    MetadataResolutionRequest setProxies( List<Proxy> proxies );
-
-    List<Proxy> getProxies();
-
 }



Mime
View raw message