PR: MNG-260

Make sure the local repository is consistent after a snapshot deployment


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163913 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-12 06:14:52 +00:00
parent 45541c5564
commit ccfdf7af42
1 changed files with 13 additions and 0 deletions

View File

@ -26,8 +26,10 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
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 @@ public class DefaultArtifactDeployer
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 @@ public class DefaultArtifactDeployer
{
throw new ArtifactDeploymentException( "Error deploying artifact: ", e );
}
catch ( IOException e )
{
throw new ArtifactDeploymentException( "Error deploying artifact: ", e );
}
}
}