maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/resolver ArtifactResolverTest.java
Date Tue, 08 Feb 2005 04:12:58 GMT
brett       2005/02/07 20:12:58

  Modified:    maven-core/src/main/java/org/apache/maven/artifact
                        MavenMetadataSource.java
               maven-core/src/main/java/org/apache/maven/execution
                        AbstractMavenExecutionRequest.java
               maven-core/src/main/java/org/apache/maven/lifecycle/goal/phase
                        DependencyResolutionPhase.java
               maven-core/src/main/java/org/apache/maven/plugin
                        DefaultPluginManager.java
               maven-core/src/main/java/org/apache/maven/project/interpolation
                        RegexBasedProjectInterpolator.java
               maven-core/src/main/java/org/apache/maven/project
                        DefaultMavenProjectBuilder.java MavenProject.java
               maven-artifact/src/main/java/org/apache/maven/artifact/metadata
                        ArtifactMetadataSource.java
               maven-artifact/src/main/java/org/apache/maven/artifact/resolver
                        DefaultArtifactResolver.java
               maven-artifact/src/test/java/org/apache/maven/artifact/resolver
                        ArtifactResolverTest.java
  Log:
  reduce number of classes holding on to localRepository unnecessarily
  
  Revision  Changes    Path
  1.9       +4 -11     maven-components/maven-core/src/main/java/org/apache/maven/artifact/MavenMetadataSource.java
  
  Index: MavenMetadataSource.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/artifact/MavenMetadataSource.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- MavenMetadataSource.java	8 Feb 2005 03:26:05 -0000	1.8
  +++ MavenMetadataSource.java	8 Feb 2005 04:12:57 -0000	1.9
  @@ -39,22 +39,15 @@
       implements ArtifactMetadataSource
   {
       private MavenProjectBuilder mavenProjectBuilder;
  -
  -    //    private MavenXpp3Reader reader = new MavenXpp3Reader();
  -
  -    private ArtifactRepository localRepository;
       private ArtifactResolver artifactResolver;
   
  -    public MavenMetadataSource( ArtifactRepository localRepository,
  -                                ArtifactResolver artifactResolver,
  -                                MavenProjectBuilder projectBuilder )
  +    public MavenMetadataSource( ArtifactResolver artifactResolver, MavenProjectBuilder
projectBuilder )
       {
  -        this.localRepository = localRepository;
           this.artifactResolver = artifactResolver;
           this.mavenProjectBuilder = projectBuilder;
       }
   
  -    public Set retrieve( Artifact artifact, Set remoteRepositories )
  +    public Set retrieve( Artifact artifact, ArtifactRepository localRepository, Set remoteRepositories
)
           throws ArtifactMetadataRetrievalException
       {
           Set artifacts;
  @@ -63,7 +56,7 @@
                                                            artifact.getVersion(),
                                                            "pom" );
           try
  -              {
  +        {
               artifactResolver.resolve( metadataArtifact, remoteRepositories, localRepository
);
   
               // [jdcasey/03-Feb-2005]: Replacing with ProjectBuilder, to enable
  
  
  
  1.5       +2 -1      maven-components/maven-core/src/main/java/org/apache/maven/execution/AbstractMavenExecutionRequest.java
  
  Index: AbstractMavenExecutionRequest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/execution/AbstractMavenExecutionRequest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractMavenExecutionRequest.java	3 Feb 2005 11:39:26 -0000	1.4
  +++ AbstractMavenExecutionRequest.java	8 Feb 2005 04:12:57 -0000	1.5
  @@ -32,6 +32,7 @@
   public class AbstractMavenExecutionRequest
   implements MavenExecutionRequest
   {
  +    // @todo [BP] is this required? This hands off to MavenSession, but could be passed
through the handler.handle function (+ createSession) 
       protected ArtifactRepository localRepository;
       protected final Properties parameters;
       protected List goals;
  
  
  
  1.10      +2 -3      maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/goal/phase/DependencyResolutionPhase.java
  
  Index: DependencyResolutionPhase.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/goal/phase/DependencyResolutionPhase.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DependencyResolutionPhase.java	8 Feb 2005 03:26:05 -0000	1.9
  +++ DependencyResolutionPhase.java	8 Feb 2005 04:12:57 -0000	1.10
  @@ -82,8 +82,7 @@
   
               projectBuilder = (MavenProjectBuilder) context.lookup( MavenProjectBuilder.ROLE
);
   
  -            MavenMetadataSource sourceReader = new MavenMetadataSource( context.getLocalRepository(),
  -                                                                        artifactResolver,
  +            MavenMetadataSource sourceReader = new MavenMetadataSource( artifactResolver,
                                                                           projectBuilder
);
   
               ArtifactResolutionResult result = artifactResolver.resolveTransitively( project.getArtifacts(),
  
  
  
  1.26      +1 -2      maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
  
  Index: DefaultPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DefaultPluginManager.java	8 Feb 2005 03:26:05 -0000	1.25
  +++ DefaultPluginManager.java	8 Feb 2005 04:12:57 -0000	1.26
  @@ -214,8 +214,7 @@
   
           mavenProjectBuilder = (MavenProjectBuilder) container.lookup( MavenProjectBuilder.ROLE
);
   
  -        MavenMetadataSource metadataSource = new MavenMetadataSource( session.getLocalRepository(),
  -                                                                      artifactResolver,
  +        MavenMetadataSource metadataSource = new MavenMetadataSource( artifactResolver,
                                                                         mavenProjectBuilder
);
   
           ( (ArtifactEnabledContainer) container ).addComponent( pluginArtifact,
  
  
  
  1.2       +0 -1      maven-components/maven-core/src/main/java/org/apache/maven/project/interpolation/RegexBasedProjectInterpolator.java
  
  Index: RegexBasedProjectInterpolator.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/interpolation/RegexBasedProjectInterpolator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegexBasedProjectInterpolator.java	3 Feb 2005 20:54:14 -0000	1.1
  +++ RegexBasedProjectInterpolator.java	8 Feb 2005 04:12:57 -0000	1.2
  @@ -76,7 +76,6 @@
           }
   
           MavenProject newProject = new MavenProject( model );
  -        newProject.setLocalRepository( project.getLocalRepository() );
           newProject.setParent( project.getParent() );
           newProject.setFile( project.getFile() );
           newProject.setArtifacts( project.getArtifacts() );
  
  
  
  1.29      +1 -4      maven-components/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
  
  Index: DefaultMavenProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- DefaultMavenProjectBuilder.java	8 Feb 2005 03:26:05 -0000	1.28
  +++ DefaultMavenProjectBuilder.java	8 Feb 2005 04:12:57 -0000	1.29
  @@ -118,8 +118,6 @@
   
               projectDefaultsInjector.injectDefaults( project );
   
  -            project.setLocalRepository( localRepository );
  -
               project.setArtifacts( artifactFactory.createArtifacts( project.getDependencies(),
                   localRepository ) );
   
  @@ -142,8 +140,7 @@
               {
                   Set repos = RepositoryUtils.mavenToWagon( project.getRepositories() );
   
  -                MavenMetadataSource sourceReader = new MavenMetadataSource( localRepository,
  -                    artifactResolver, this );
  +                MavenMetadataSource sourceReader = new MavenMetadataSource( artifactResolver,
this );
   
                   ArtifactResolutionResult result = artifactResolver.resolveTransitively(
project
                       .getArtifacts(), repos, localRepository, sourceReader );
  
  
  
  1.16      +0 -13     maven-components/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
  
  Index: MavenProject.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/MavenProject.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MavenProject.java	3 Feb 2005 20:54:15 -0000	1.15
  +++ MavenProject.java	8 Feb 2005 04:12:57 -0000	1.16
  @@ -18,7 +18,6 @@
    */
   
   import org.apache.maven.artifact.Artifact;
  -import org.apache.maven.artifact.repository.ArtifactRepository;
   import org.apache.maven.model.Build;
   import org.apache.maven.model.CiManagement;
   import org.apache.maven.model.Contributor;
  @@ -64,8 +63,6 @@
   
       private Set artifacts;
   
  -    private ArtifactRepository wagonLocalRepository;
  -
       public MavenProject( Model model )
       {
           this.model = model;
  @@ -520,16 +517,6 @@
           return model.getRepositories();
       }
   
  -    public void setLocalRepository( ArtifactRepository repository )
  -    {
  -        this.wagonLocalRepository = repository;
  -    }
  -    
  -    public ArtifactRepository getLocalRepository()
  -    {
  -        return wagonLocalRepository;
  -    }
  -
       // ----------------------------------------------------------------------
       // Decorators
       // ----------------------------------------------------------------------
  
  
  
  1.3       +3 -2      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java
  
  Index: ArtifactMetadataSource.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ArtifactMetadataSource.java	8 Feb 2005 03:26:06 -0000	1.2
  +++ ArtifactMetadataSource.java	8 Feb 2005 04:12:57 -0000	1.3
  @@ -1,6 +1,7 @@
   package org.apache.maven.artifact.metadata;
   
   import org.apache.maven.artifact.Artifact;
  +import org.apache.maven.artifact.repository.ArtifactRepository;
   
   import java.util.Set;
   
  @@ -31,6 +32,6 @@
    */
   public interface ArtifactMetadataSource
   {
  -    Set retrieve( Artifact artifact, Set remoteRepositories )
  +    Set retrieve( Artifact artifact, ArtifactRepository localRepository, Set remoteRepositories
)
           throws ArtifactMetadataRetrievalException;
   }
  
  
  
  1.9       +1 -1      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
  
  Index: DefaultArtifactResolver.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultArtifactResolver.java	8 Feb 2005 03:26:06 -0000	1.8
  +++ DefaultArtifactResolver.java	8 Feb 2005 04:12:58 -0000	1.9
  @@ -227,7 +227,7 @@
   
                       try
                       {
  -                        referencedDependencies = source.retrieve( newArtifact, remoteRepositories
);
  +                        referencedDependencies = source.retrieve( newArtifact, localRepository,
remoteRepositories, source.localRepository );
                       }
                       catch ( ArtifactMetadataRetrievalException e )
                       {
  
  
  
  1.6       +4 -3      maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolverTest.java
  
  Index: ArtifactResolverTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolverTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ArtifactResolverTest.java	8 Feb 2005 03:26:06 -0000	1.5
  +++ ArtifactResolverTest.java	8 Feb 2005 04:12:58 -0000	1.6
  @@ -21,6 +21,7 @@
   import org.apache.maven.artifact.DefaultArtifact;
   import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
   import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
  +import org.apache.maven.artifact.repository.ArtifactRepository;
   
   import java.util.HashSet;
   import java.util.Set;
  @@ -137,7 +138,7 @@
   
           ArtifactMetadataSource mds = new ArtifactMetadataSource()
           {
  -            public Set retrieve( Artifact artifact, Set remoteRepositories )
  +            public Set retrieve( Artifact artifact, ArtifactRepository localRepository,
Set remoteRepositories )
                   throws ArtifactMetadataRetrievalException
               {
                   Set dependencies = new HashSet();
  @@ -185,7 +186,7 @@
   
           ArtifactMetadataSource mds = new ArtifactMetadataSource()
           {
  -            public Set retrieve( Artifact artifact, Set remoteRepositories )
  +            public Set retrieve( Artifact artifact, ArtifactRepository localRepository,
Set remoteRepositories )
                   throws ArtifactMetadataRetrievalException
               {
                   Set dependencies = new HashSet();
  
  
  

Mime
View raw message