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 08:42:57 GMT
brett       2005/03/23 00:42:57

  Modified:    maven-core/src/test/java/org/apache/maven/project
                        ProjectClasspathArtifactResolver.java
                        ProjectClasspathTest.java
               maven-core/src/test/resources/org/apache/maven/project
                        ProjectClasspathTest.xml
               maven-artifact/src/main/java/org/apache/maven/artifact/deployer
                        DefaultArtifactDeployer.java
               maven-artifact/src/main/java/org/apache/maven/artifact/handler/manager
                        ArtifactHandlerManager.java
                        DefaultArtifactHandlerManager.java
               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/transform
                        ArtifactTransformation.java
                        SnapshotTransformation.java
               maven-artifact/src/main/resources/META-INF/plexus
                        components.xml
  Removed:     maven-artifact/src/main/java/org/apache/maven/artifact
                        AbstractArtifactComponent.java
  Log:
  o put all of the path functions back into the artifact handler manager - that class likely
needs a rename.
  o Removed AbstractArtifactComponent as it was simply delegating to the class and prevented
other inheritence for the resolver which seems more appropriate.
  o fixed test failure in ProjectClasspathTest due to incorrectly constructed component -
using plexus even though still working around the problem with a hack
  
  Revision  Changes    Path
  1.5       +6 -10     maven-components/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java
  
  Index: ProjectClasspathArtifactResolver.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ProjectClasspathArtifactResolver.java	21 Mar 2005 08:18:33 -0000	1.4
  +++ ProjectClasspathArtifactResolver.java	23 Mar 2005 08:42:56 -0000	1.5
  @@ -73,29 +73,25 @@
           return artifact;
       }
   
  -    protected void setLocalRepositoryPath( Artifact artifact, ArtifactRepository localRepository
)
  -    {
  -    }
  -
       public ArtifactResolutionResult resolveTransitively( Set artifacts, List remoteRepositories,
  -                                                        ArtifactRepository localRepository,
  -                                                        ArtifactMetadataSource source,
ArtifactFilter filter )
  +                                                         ArtifactRepository localRepository,
  +                                                         ArtifactMetadataSource source,
ArtifactFilter filter )
           throws ArtifactResolutionException
       {
           return super.resolveTransitively( artifacts, remoteRepositories, localRepository,
new Source( this ), filter );
       }
   
       public ArtifactResolutionResult resolveTransitively( Set artifacts, List remoteRepositories,
  -                                                        ArtifactRepository localRepository,
  -                                                        ArtifactMetadataSource source )
  +                                                         ArtifactRepository localRepository,
  +                                                         ArtifactMetadataSource source
)
           throws ArtifactResolutionException
       {
           return super.resolveTransitively( artifacts, remoteRepositories, localRepository,
new Source( this ) );
       }
   
       public ArtifactResolutionResult resolveTransitively( Artifact artifact, List remoteRepositories,
  -                                                        ArtifactRepository localRepository,
  -                                                        ArtifactMetadataSource source )
  +                                                         ArtifactRepository localRepository,
  +                                                         ArtifactMetadataSource source
)
           throws ArtifactResolutionException
       {
           return super.resolveTransitively( artifact, remoteRepositories, localRepository,
new Source( this ) );
  
  
  
  1.6       +2 -2      maven-components/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
  
  Index: ProjectClasspathTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ProjectClasspathTest.java	17 Mar 2005 02:04:35 -0000	1.5
  +++ ProjectClasspathTest.java	23 Mar 2005 08:42:56 -0000	1.6
  @@ -38,12 +38,12 @@
           File f = getTestFile( dir + "project-with-scoped-dependencies.xml" );
   
           // XXX: Because this test fails, we resort to crude reflection hacks, see PLX-108
for the solution
  -//        assertEquals( ProjectClasspathArtifactResolver.class.getName(), getContainer().lookup(
ArtifactResolver.ROLE ) );
  +//        assertEquals( ProjectClasspathArtifactResolver.class, getContainer().lookup(
ArtifactResolver.ROLE ).getClass() );
           MavenProjectBuilder builder = (MavenProjectBuilder) getContainer().lookup( MavenProjectBuilder.ROLE
);
           Field declaredField = builder.getClass().getDeclaredField( "artifactResolver" );
           boolean acc = declaredField.isAccessible();
           declaredField.setAccessible( true );
  -        declaredField.set( builder, new ProjectClasspathArtifactResolver() );
  +        declaredField.set( builder, getContainer().lookup( ProjectClasspathArtifactResolver.class.getName()
) );
           declaredField.setAccessible( acc );
           // XXX: end hack
   
  
  
  
  1.3       +14 -1     maven-components/maven-core/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml
  
  Index: ProjectClasspathTest.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProjectClasspathTest.xml	9 Mar 2005 05:48:30 -0000	1.2
  +++ ProjectClasspathTest.xml	23 Mar 2005 08:42:56 -0000	1.3
  @@ -1,5 +1,6 @@
   <plexus>
     <components>
  +    <!-- Due to PLX-108, have to work around it...
       <component>
         <role>org.apache.maven.artifact.ArtifactResolver</role>
         <implementation>org.apache.maven.project.ProjectClasspathArtifactResolver</implementation>
  @@ -9,7 +10,19 @@
           </requirement>
           <requirement>
             <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
  -          <field-name>artifactHandlerManager</field-name>
  +        </requirement>
  +      </requirements>
  +    </component>
  +    -->
  +    <component>
  +      <role>org.apache.maven.project.ProjectClasspathArtifactResolver</role>
  +      <implementation>org.apache.maven.project.ProjectClasspathArtifactResolver</implementation>
  +      <requirements>
  +        <requirement>
  +          <role>org.apache.maven.artifact.manager.WagonManager</role>
  +        </requirement>
  +        <requirement>
  +          <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
           </requirement>
         </requirements>
       </component>
  
  
  
  1.3       +4 -3      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
  
  Index: DefaultArtifactDeployer.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultArtifactDeployer.java	23 Mar 2005 03:40:12 -0000	1.2
  +++ DefaultArtifactDeployer.java	23 Mar 2005 08:42:56 -0000	1.3
  @@ -16,8 +16,8 @@
    * limitations under the License.
    */
   
  -import org.apache.maven.artifact.AbstractArtifactComponent;
   import org.apache.maven.artifact.Artifact;
  +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
   import org.apache.maven.artifact.handler.manager.ArtifactHandlerNotFoundException;
   import org.apache.maven.artifact.manager.WagonManager;
   import org.apache.maven.artifact.repository.ArtifactRepository;
  @@ -28,11 +28,12 @@
    * @todo snapshot notions need to be dealt with in one place.
    */
   public class DefaultArtifactDeployer
  -    extends AbstractArtifactComponent
       implements ArtifactDeployer
   {
       private WagonManager wagonManager;
   
  +    private ArtifactHandlerManager artifactHandlerManager;
  +
       public void deploy( String basedir, Artifact artifact, ArtifactRepository deploymentRepository
)
           throws ArtifactDeploymentException
       {
  @@ -40,7 +41,7 @@
   
           try
           {
  -            source = getArtifactHandler( artifact.getType() ).source( basedir, artifact
);
  +            source = artifactHandlerManager.getArtifactHandler( artifact.getType() ).source(
basedir, artifact );
           }
           catch ( ArtifactHandlerNotFoundException e )
           {
  
  
  
  1.5       +8 -10     maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java
  
  Index: ArtifactHandlerManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ArtifactHandlerManager.java	22 Mar 2005 06:51:16 -0000	1.4
  +++ ArtifactHandlerManager.java	23 Mar 2005 08:42:56 -0000	1.5
  @@ -16,9 +16,10 @@
    * limitations under the License.
    */
   
  +import org.apache.maven.artifact.Artifact;
   import org.apache.maven.artifact.handler.ArtifactHandler;
  -
  -import java.util.Set;
  +import org.apache.maven.artifact.repository.ArtifactRepository;
  +import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException;
   
   /**
    * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  @@ -31,12 +32,9 @@
       ArtifactHandler getArtifactHandler( String type )
           throws ArtifactHandlerNotFoundException;
   
  -    //    String localRepositoryPath( Artifact artifact, ArtifactRepository localRepository
)
  -    //         throws ArtifactHandlerNotFoundException;
  -    //
  -    //    String path( Artifact artifact )
  -    //        throws ArtifactHandlerNotFoundException;
  -
  -    Set getHandlerTypes();
  +    String getLocalRepositoryArtifactPath( Artifact artifact, ArtifactRepository localRepository
)
  +        throws ArtifactPathFormatException;
   
  +    String getRemoteRepositoryArtifactPath( Artifact artifact, ArtifactRepository remoteRepository
)
  +        throws ArtifactPathFormatException;
   }
  \ No newline at end of file
  
  
  
  1.9       +32 -28    maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java
  
  Index: DefaultArtifactHandlerManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultArtifactHandlerManager.java	23 Mar 2005 03:40:12 -0000	1.8
  +++ DefaultArtifactHandlerManager.java	23 Mar 2005 08:42:56 -0000	1.9
  @@ -16,9 +16,15 @@
    * limitations under the License.
    */
   
  +import org.apache.maven.artifact.Artifact;
   import org.apache.maven.artifact.handler.ArtifactHandler;
  +import org.apache.maven.artifact.repository.ArtifactRepository;
  +import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException;
   import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
  +import org.apache.maven.artifact.transform.ArtifactTransformation;
   
  +import java.util.Iterator;
  +import java.util.List;
   import java.util.Map;
   import java.util.Set;
   
  @@ -30,6 +36,8 @@
   public class DefaultArtifactHandlerManager
       implements ArtifactHandlerManager
   {
  +    private List artifactTransformations;
  +
       private Map artifactHandlers;
   
       private ArtifactRepositoryLayout artifactRepositoryLayout;
  @@ -52,33 +60,29 @@
           return artifactHandlers.keySet();
       }
   
  -    // ----------------------------------------------------------------------
  -    //
  -    // ----------------------------------------------------------------------
  -
  -    //    public String localRepositoryPath( Artifact artifact, ArtifactRepository localRepository
)
  -    //        throws ArtifactHandlerNotFoundException
  -    //    {
  -    //        return localRepository.getBasedir() + "/" + path( artifact );
  -    //    }
  -    //
  -    //    public String artifactUrl( Artifact artifact, ArtifactRepository remoteRepository
)
  -    //        throws ArtifactHandlerNotFoundException
  -    //    {
  -    //        return remoteRepository.getUrl() + "/" + path( artifact );
  -    //    }
  -    //
  -    //    public String path( Artifact artifact )
  -    //        throws ArtifactHandlerNotFoundException
  -    //    {
  -    //        if ( artifact.getType() == null )
  -    //        {
  -    //            throw new ArtifactHandlerNotFoundException( "Artifact handler is null
for artifact " + artifact );
  -    //        }
  -    //
  -    //        ArtifactHandler handler = getArtifactHandler( artifact.getType() );
  -    //
  -    //        return artifactRepositoryLayout.pathOf( artifact, handler );
  -    //    }
  +    public String getRemoteRepositoryArtifactPath( Artifact artifact, ArtifactRepository
remoteRepository )
  +        throws ArtifactPathFormatException
  +    {
  +        for ( Iterator i = artifactTransformations.iterator(); i.hasNext(); )
  +        {
  +            ArtifactTransformation transform = (ArtifactTransformation) i.next();
  +            // TODO: perform transformation
  +        }
  +
  +        return remoteRepository.pathOf( artifact );
  +    }
   
  +    public String getLocalRepositoryArtifactPath( Artifact artifact, ArtifactRepository
localRepository )
  +        throws ArtifactPathFormatException
  +    {
  +        for ( Iterator i = artifactTransformations.iterator(); i.hasNext(); )
  +        {
  +            ArtifactTransformation transform = (ArtifactTransformation) i.next();
  +            artifact = transform.transformLocalArtifact( artifact, localRepository );
  +            // TODO: perform transformation
  +        }
  +
  +        String artifactPath = localRepository.getBasedir() + "/" + localRepository.pathOf(
artifact );
  +        return artifactPath;
  +    }
   }
  \ No newline at end of file
  
  
  
  1.8       +7 -4      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultArtifactInstaller.java	23 Mar 2005 07:43:38 -0000	1.7
  +++ DefaultArtifactInstaller.java	23 Mar 2005 08:42:56 -0000	1.8
  @@ -16,20 +16,23 @@
    * limitations under the License.
    */
   
  -import org.apache.maven.artifact.AbstractArtifactComponent;
   import org.apache.maven.artifact.Artifact;
  +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
   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.codehaus.plexus.logging.AbstractLogEnabled;
   import org.codehaus.plexus.util.FileUtils;
   
   import java.io.File;
   import java.io.IOException;
   
   public class DefaultArtifactInstaller
  -    extends AbstractArtifactComponent
  +    extends AbstractLogEnabled
       implements ArtifactInstaller
   {
  +    private ArtifactHandlerManager artifactHandlerManager;
  +
       public void install( String basedir, Artifact artifact, ArtifactRepository localRepository
)
           throws ArtifactInstallationException
       {
  @@ -37,7 +40,7 @@
   
           try
           {
  -            source = getArtifactHandler( artifact.getType() ).source( basedir, artifact
);
  +            source = artifactHandlerManager.getArtifactHandler( artifact.getType() ).source(
basedir, artifact );
           }
           catch ( ArtifactHandlerNotFoundException e )
           {
  @@ -52,7 +55,7 @@
       {
           try
           {
  -            artifact.setPath( getLocalRepositoryArtifactPath( artifact, localRepository
) );
  +            artifact.setPath( artifactHandlerManager.getLocalRepositoryArtifactPath( artifact,
localRepository ) );
   
               if ( !artifact.getFile().getParentFile().exists() )
               {
  
  
  
  1.18      +7 -4      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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DefaultWagonManager.java	23 Mar 2005 07:41:39 -0000	1.17
  +++ DefaultWagonManager.java	23 Mar 2005 08:42:57 -0000	1.18
  @@ -16,8 +16,8 @@
    * limitations under the License.
    */
   
  -import org.apache.maven.artifact.AbstractArtifactComponent;
   import org.apache.maven.artifact.Artifact;
  +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
   import org.apache.maven.artifact.repository.ArtifactRepository;
   import org.apache.maven.wagon.ConnectionException;
   import org.apache.maven.wagon.ResourceDoesNotExistException;
  @@ -33,6 +33,7 @@
   import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
   import org.codehaus.plexus.context.Context;
   import org.codehaus.plexus.context.ContextException;
  +import org.codehaus.plexus.logging.AbstractLogEnabled;
   import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
   import org.codehaus.plexus.util.FileUtils;
   
  @@ -44,7 +45,7 @@
   import java.util.Map;
   
   public class DefaultWagonManager
  -    extends AbstractArtifactComponent
  +    extends AbstractLogEnabled
       implements WagonManager, Contextualizable
   {
       private PlexusContainer container;
  @@ -53,6 +54,8 @@
   
       private TransferListener downloadMonitor;
   
  +    private ArtifactHandlerManager artifactHandlerManager;
  +
       public Wagon getWagon( String protocol )
           throws UnsupportedProtocolException
       {
  @@ -86,7 +89,7 @@
   
           wagon.connect( repository, getProxy( repository.getProtocol() ) );
   
  -        wagon.put( source, getRemoteRepositoryArtifactPath( artifact, repository ) );
  +        wagon.put( source, artifactHandlerManager.getRemoteRepositoryArtifactPath( artifact,
repository ) );
   
           wagon.disconnect();
   
  @@ -155,7 +158,7 @@
   
                   wagon.connect( repository, getProxy( repository.getProtocol() ) );
   
  -                String remotePath = getRemoteRepositoryArtifactPath( artifact, repository
);
  +                String remotePath = artifactHandlerManager.getRemoteRepositoryArtifactPath(
artifact, repository );
   
                   wagon.get( remotePath, temp );
   
  
  
  
  1.26      +8 -6      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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DefaultArtifactResolver.java	23 Mar 2005 07:43:38 -0000	1.25
  +++ DefaultArtifactResolver.java	23 Mar 2005 08:42:57 -0000	1.26
  @@ -16,9 +16,9 @@
    * limitations under the License.
    */
   
  -import org.apache.maven.artifact.AbstractArtifactComponent;
   import org.apache.maven.artifact.Artifact;
   import org.apache.maven.artifact.construction.ArtifactConstructionSupport;
  +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
   import org.apache.maven.artifact.manager.WagonManager;
   import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
   import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
  @@ -26,6 +26,7 @@
   import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException;
   import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
   import org.apache.maven.wagon.TransferFailedException;
  +import org.codehaus.plexus.logging.AbstractLogEnabled;
   import org.codehaus.plexus.logging.Logger;
   
   import java.util.Collections;
  @@ -38,11 +39,10 @@
   import java.util.Set;
   
   /**
  - * @todo get rid of {@link AbstractArtifactComponent}and then create an
  - * AbstractArtifactResolver that does the transitive boilerplate
  + * @todo create an AbstractArtifactResolver that does the transitive boilerplate
    */
   public class DefaultArtifactResolver
  -    extends AbstractArtifactComponent
  +    extends AbstractLogEnabled
       implements ArtifactResolver
   {
       // ----------------------------------------------------------------------
  @@ -51,6 +51,8 @@
   
       private WagonManager wagonManager;
   
  +    private ArtifactHandlerManager artifactHandlerManager;
  +
       // ----------------------------------------------------------------------
       // Implementation
       // ----------------------------------------------------------------------
  @@ -77,7 +79,7 @@
               logger.debug( "Resolving: " + artifact.getId() + " from:\n" + "{localRepository:
" + localRepository +
                             "}\n" + "{remoteRepositories: " + remoteRepositories + "}" );
   
  -            artifact.setPath( getLocalRepositoryArtifactPath( artifact, localRepository
) );
  +            artifact.setPath( artifactHandlerManager.getLocalRepositoryArtifactPath( artifact,
localRepository ) );
   
               if ( artifact.exists() )
               {
  @@ -294,7 +296,7 @@
   
               try
               {
  -                artifact.setPath( getLocalRepositoryArtifactPath( artifact, localRepository
) );
  +                artifact.setPath( artifactHandlerManager.getLocalRepositoryArtifactPath(
artifact, localRepository ) );
               }
               catch ( ArtifactPathFormatException e )
               {
  
  
  
  1.2       +2 -6      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/transform/ArtifactTransformation.java
  
  Index: ArtifactTransformation.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/transform/ArtifactTransformation.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ArtifactTransformation.java	23 Mar 2005 07:23:23 -0000	1.1
  +++ ArtifactTransformation.java	23 Mar 2005 08:42:57 -0000	1.2
  @@ -19,9 +19,6 @@
   import org.apache.maven.artifact.Artifact;
   import org.apache.maven.artifact.repository.ArtifactRepository;
   
  -import java.util.List;
  -import java.util.Map;
  -
   /**
    * @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
    * @version $Id: ArtifactTransformation.java,v 1.1 2005/03/03 15:37:25
  @@ -32,12 +29,11 @@
       static String ROLE = ArtifactTransformation.class.getName();
   
       /**
  -     * Take in a artifact and return the transformed artifact. If no
  +     * Take in a artifact and return the transformed artifact for locating in the local
repository. If no
        * transformation has occured the original artifact is returned.
        *
        * @param artifact Artifact to be transformed.
        * @return The transformed Artifact
        */
  -    Artifact transform( Artifact artifact, ArtifactRepository localRepository, List remoteRepositories,
Map parameters )
  -        throws Exception;
  +    Artifact transformLocalArtifact( Artifact artifact, ArtifactRepository localRepository
);
   }
  \ No newline at end of file
  
  
  
  1.2       +13 -17    maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java
  
  Index: SnapshotTransformation.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SnapshotTransformation.java	23 Mar 2005 07:23:23 -0000	1.1
  +++ SnapshotTransformation.java	23 Mar 2005 08:42:57 -0000	1.2
  @@ -18,27 +18,17 @@
   
   import org.apache.maven.artifact.Artifact;
   import org.apache.maven.artifact.repository.ArtifactRepository;
  -import org.apache.maven.artifact.resolver.ArtifactResolver;
  -import org.codehaus.plexus.util.FileUtils;
  -
  -import java.io.File;
  -import java.text.ParseException;
  -import java.text.SimpleDateFormat;
  -import java.util.Date;
  -import java.util.List;
  -import java.util.Map;
  -import java.util.TimeZone;
   
   /**
  - * @author <a href="mailto:mmaczka@interia.pl">Michal Maczka </a>
  + * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  + * @author <a href="mailto:mmaczka@interia.pl">Michal Maczka</a>
    * @version $Id: SnapshotTransformation.java,v 1.1 2005/03/03 15:37:25
    *          jvanzyl Exp $
    */
   public class SnapshotTransformation
       implements ArtifactTransformation
   {
  -    private ArtifactResolver artifactResolver;
  -
  +/*
       public Artifact transform( Artifact artifact, ArtifactRepository localRepository, List
repositories,
                                  Map parameters )
           throws Exception
  @@ -146,10 +136,10 @@
   
                   //@todo we should "normalize" the time.
   
  -                /*
  -                 * TimeZone gmtTimeZone = TimeZone.getTimeZone( "GMT" );
  -                 * TimeZone userTimeZone = TimeZone.getDefault(); long diff =
  -                 */
  +                //
  +                // TimeZone gmtTimeZone = TimeZone.getTimeZone( "GMT" );
  +                // TimeZone userTimeZone = TimeZone.getDefault(); long diff =
  +                //
               }
           }
   
  @@ -192,4 +182,10 @@
   
           return retValue;
       }
  +    */
  +    public Artifact transformLocalArtifact( Artifact artifact, ArtifactRepository localRepository
)
  +    {
  +        // TODO: implement
  +        return artifact;
  +    }
   }
  \ No newline at end of file
  
  
  
  1.14      +4 -12     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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- components.xml	23 Mar 2005 07:41:39 -0000	1.13
  +++ components.xml	23 Mar 2005 08:42:57 -0000	1.14
  @@ -25,10 +25,6 @@
           <requirement>
             <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
           </requirement>
  -        <requirement>
  -          <role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
  -          <field-name>artifactTransformations</field-name>
  -        </requirement>
         </requirements>
       </component>
   
  @@ -59,10 +55,6 @@
           <requirement>
             <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
           </requirement>
  -        <requirement>
  -          <role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
  -          <field-name>artifactTransformations</field-name>
  -        </requirement>
         </requirements>
       </component>
   
  @@ -81,10 +73,6 @@
           <requirement>
             <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
           </requirement>
  -        <requirement>
  -          <role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
  -          <field-name>artifactTransformations</field-name>
  -        </requirement>
         </requirements>
       </component>
   
  @@ -123,6 +111,10 @@
             <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
             <field-name>artifactHandlers</field-name>
           </requirement>
  +        <requirement>
  +          <role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
  +          <field-name>artifactTransformations</field-name>
  +        </requirement>
         </requirements>
       </component>
   
  
  
  

Mime
View raw message