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/java/org/apache/maven/artifact/deployer DefaultArtifactDeployer.java
Date Tue, 12 Apr 2005 06:14:52 GMT
brett       2005/04/11 23:14:52

  Modified:    maven-artifact/src/main/java/org/apache/maven/artifact/deployer
                        DefaultArtifactDeployer.java
  Log:
  PR: MNG-260
  Make sure the local repository is consistent after a snapshot deployment
  
  Revision  Changes    Path
  1.8       +13 -0     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultArtifactDeployer.java	29 Mar 2005 16:41:13 -0000	1.7
  +++ DefaultArtifactDeployer.java	12 Apr 2005 06:14:52 -0000	1.8
  @@ -26,8 +26,10 @@
   import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException;
   import org.apache.maven.artifact.transform.ArtifactTransformation;
   import org.apache.maven.wagon.TransferFailedException;
  +import org.codehaus.plexus.util.FileUtils;
   
   import java.io.File;
  +import java.io.IOException;
   import java.util.Iterator;
   import java.util.List;
   
  @@ -71,6 +73,13 @@
                   transform.transformForDeployment( artifact, deploymentRepository );
               }
   
  +            // Copy the original file to the new one if it was transformed
  +            File artifactFile = new File( localRepository.getBasedir(), localRepository.pathOf(
artifact ) );
  +            if ( !artifactFile.equals( source ) )
  +            {
  +                FileUtils.copyFile( source, artifactFile );
  +            }
  +
               wagonManager.putArtifact( source, artifact, deploymentRepository );
   
               // must be after the artifact is installed
  @@ -95,5 +104,9 @@
           {
               throw new ArtifactDeploymentException( "Error deploying artifact: ", e );
           }
  +        catch ( IOException e )
  +        {
  +            throw new ArtifactDeploymentException( "Error deploying artifact: ", e );
  +        }
       }
   }
  
  
  

Mime
View raw message