mirror of https://github.com/apache/maven.git
[MNG-4368] DefaultArtifactInstaller should only overwrite files if timestamp has changed
o Revised to install upon any difference in file timestamp or length git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@894114 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fa6330023c
commit
9d137583dd
|
@ -82,7 +82,19 @@ public class DefaultArtifactInstaller
|
||||||
|
|
||||||
getLogger().info( "Installing " + source.getPath() + " to " + destination );
|
getLogger().info( "Installing " + source.getPath() + " to " + destination );
|
||||||
|
|
||||||
FileUtils.copyFileIfModified( source, destination );
|
boolean copy =
|
||||||
|
!destination.exists() || "pom".equals( artifact.getType() )
|
||||||
|
|| source.lastModified() != destination.lastModified() || source.length() != destination.length();
|
||||||
|
|
||||||
|
if ( copy )
|
||||||
|
{
|
||||||
|
FileUtils.copyFile( source, destination );
|
||||||
|
destination.setLastModified( source.lastModified() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getLogger().debug( "Skipped re-installation of " + destination + ", seems unchanged" );
|
||||||
|
}
|
||||||
|
|
||||||
// must be after the artifact is installed
|
// must be after the artifact is installed
|
||||||
for ( ArtifactMetadata metadata : artifact.getMetadataList() )
|
for ( ArtifactMetadata metadata : artifact.getMetadataList() )
|
||||||
|
|
Loading…
Reference in New Issue