mirror of https://github.com/apache/maven.git
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:
parent
45541c5564
commit
ccfdf7af42
|
@ -26,8 +26,10 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||||
import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException;
|
import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException;
|
||||||
import org.apache.maven.artifact.transform.ArtifactTransformation;
|
import org.apache.maven.artifact.transform.ArtifactTransformation;
|
||||||
import org.apache.maven.wagon.TransferFailedException;
|
import org.apache.maven.wagon.TransferFailedException;
|
||||||
|
import org.codehaus.plexus.util.FileUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -71,6 +73,13 @@ public class DefaultArtifactDeployer
|
||||||
transform.transformForDeployment( artifact, deploymentRepository );
|
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 );
|
wagonManager.putArtifact( source, artifact, deploymentRepository );
|
||||||
|
|
||||||
// must be after the artifact is installed
|
// must be after the artifact is installed
|
||||||
|
@ -95,5 +104,9 @@ public class DefaultArtifactDeployer
|
||||||
{
|
{
|
||||||
throw new ArtifactDeploymentException( "Error deploying artifact: ", e );
|
throw new ArtifactDeploymentException( "Error deploying artifact: ", e );
|
||||||
}
|
}
|
||||||
|
catch ( IOException e )
|
||||||
|
{
|
||||||
|
throw new ArtifactDeploymentException( "Error deploying artifact: ", e );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue