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/main/resources/META-INF/plexus components.xml
Date Wed, 23 Mar 2005 07:41:39 GMT
brett       2005/03/22 23:41:39

  Modified:    maven-artifact/src/main/java/org/apache/maven/artifact/installer
                        DefaultArtifactInstaller.java
               maven-artifact/src/main/java/org/apache/maven/artifact/manager
                        DefaultWagonManager.java
               maven-artifact/src/main/java/org/apache/maven/artifact/resolver
                        DefaultArtifactResolver.java
               maven-artifact/src/main/java/org/apache/maven/artifact
                        AbstractArtifactComponent.java
               maven-artifact/src/main/resources/META-INF/plexus
                        components.xml
  Log:
  o a little refactoring
  o hook in snapshot transformation, though it isn't used
  
  Revision  Changes    Path
  1.6       +1 -1      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java
  
  Index: DefaultArtifactInstaller.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultArtifactInstaller.java	23 Mar 2005 03:40:12 -0000	1.5
  +++ DefaultArtifactInstaller.java	23 Mar 2005 07:41:39 -0000	1.6
  @@ -52,7 +52,7 @@
       {
           try
           {
  -            setLocalRepositoryPath( artifact, localRepository );
  +            artifact.setPath( getLocalRepositoryArtifactPath( localRepository, artifact
) );
   
               if ( !artifact.getFile().getParentFile().exists() )
               {
  
  
  
  1.17      +2 -2      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
  
  Index: DefaultWagonManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DefaultWagonManager.java	23 Mar 2005 03:40:12 -0000	1.16
  +++ DefaultWagonManager.java	23 Mar 2005 07:41:39 -0000	1.17
  @@ -86,7 +86,7 @@
   
           wagon.connect( repository, getProxy( repository.getProtocol() ) );
   
  -        wagon.put( source, path( artifact, repository ) );
  +        wagon.put( source, getRemoteRepositoryArtifactPath( artifact, repository ) );
   
           wagon.disconnect();
   
  @@ -155,7 +155,7 @@
   
                   wagon.connect( repository, getProxy( repository.getProtocol() ) );
   
  -                String remotePath = path( artifact, repository );
  +                String remotePath = getRemoteRepositoryArtifactPath( artifact, repository
);
   
                   wagon.get( remotePath, temp );
   
  
  
  
  1.24      +2 -2      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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DefaultArtifactResolver.java	23 Mar 2005 07:23:23 -0000	1.23
  +++ DefaultArtifactResolver.java	23 Mar 2005 07:41:39 -0000	1.24
  @@ -77,7 +77,7 @@
               logger.debug( "Resolving: " + artifact.getId() + " from:\n" + "{localRepository:
" + localRepository +
                             "}\n" + "{remoteRepositories: " + remoteRepositories + "}" );
   
  -            setLocalRepositoryPath( artifact, localRepository );
  +            artifact.setPath( getLocalRepositoryArtifactPath( localRepository, artifact
) );
   
               if ( artifact.exists() )
               {
  @@ -294,7 +294,7 @@
   
               try
               {
  -                setLocalRepositoryPath( artifact, localRepository );
  +                artifact.setPath( getLocalRepositoryArtifactPath( localRepository, artifact
) );
               }
               catch ( ArtifactPathFormatException e )
               {
  
  
  
  1.8       +12 -11    maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/AbstractArtifactComponent.java
  
  Index: AbstractArtifactComponent.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/AbstractArtifactComponent.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractArtifactComponent.java	23 Mar 2005 07:23:23 -0000	1.7
  +++ AbstractArtifactComponent.java	23 Mar 2005 07:41:39 -0000	1.8
  @@ -21,8 +21,10 @@
   import org.apache.maven.artifact.handler.manager.ArtifactHandlerNotFoundException;
   import org.apache.maven.artifact.repository.ArtifactRepository;
   import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException;
  +import org.apache.maven.artifact.transform.ArtifactTransformation;
   import org.codehaus.plexus.logging.AbstractLogEnabled;
   
  +import java.util.Iterator;
   import java.util.List;
   
   /**
  @@ -44,23 +46,22 @@
           return artifactHandlerManager.getArtifactHandler( type );
       }
   
  -    protected String path( Artifact artifact, ArtifactRepository remoteRepository )
  +    protected String getRemoteRepositoryArtifactPath( Artifact artifact, ArtifactRepository
remoteRepository )
           throws ArtifactPathFormatException
       {
           return remoteRepository.pathOf( artifact );
       }
   
  -    protected String localPath( Artifact artifact, ArtifactRepository localRepository )
  +    protected String getLocalRepositoryArtifactPath( ArtifactRepository localRepository,
Artifact artifact )
           throws ArtifactPathFormatException
       {
  -        return localRepository.getBasedir() + "/" + localRepository.pathOf( artifact );
  -    }
  -
  -    protected void setLocalRepositoryPath( Artifact artifact, ArtifactRepository localRepository
)
  -        throws ArtifactPathFormatException
  -    {
  -        String artifactPath = localPath( artifact, localRepository );
  +        for ( Iterator i = artifactTransformations.iterator(); i.hasNext(); )
  +        {
  +            ArtifactTransformation transform = (ArtifactTransformation) i.next();
  +            // TODO: perform transformation
  +        }
   
  -        artifact.setPath( artifactPath );
  +        String artifactPath = localRepository.getBasedir() + "/" + localRepository.pathOf(
artifact );
  +        return artifactPath;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.13      +9 -0      maven-components/maven-artifact/src/main/resources/META-INF/plexus/components.xml
  
  Index: components.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/resources/META-INF/plexus/components.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- components.xml	23 Mar 2005 07:23:23 -0000	1.12
  +++ components.xml	23 Mar 2005 07:41:39 -0000	1.13
  @@ -1,5 +1,14 @@
   <component-set>
     <components>
  +    <!--
  +     |
  +     | Transformations
  +     |
  +     -->
  +    <component>
  +      <role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
  +      <implementation>org.apache.maven.artifact.transform.SnapshotTransformation</implementation>
  +    </component>
   
       <!--
        |
  
  
  

Mime
View raw message