mirror of https://github.com/apache/maven.git
[MNG-4368] DefaultArtifactInstaller should only overwrite files if timestamp has changed
o Improved logging to make optimization visible to end-user git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@894349 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9121bccc93
commit
02e2e6664c
|
@ -80,20 +80,20 @@ public class DefaultArtifactInstaller
|
|||
destination.getParentFile().mkdirs();
|
||||
}
|
||||
|
||||
getLogger().info( "Installing " + source.getPath() + " to " + destination );
|
||||
|
||||
boolean copy =
|
||||
!destination.exists() || "pom".equals( artifact.getType() )
|
||||
|| source.lastModified() != destination.lastModified() || source.length() != destination.length();
|
||||
|
||||
if ( copy )
|
||||
{
|
||||
getLogger().info( "Installing " + source + " to " + destination );
|
||||
|
||||
FileUtils.copyFile( source, destination );
|
||||
destination.setLastModified( source.lastModified() );
|
||||
}
|
||||
else
|
||||
{
|
||||
getLogger().debug( "Skipped re-installation of " + destination + ", seems unchanged" );
|
||||
getLogger().info( "Skipped re-installing " + source + " to " + destination + ", seems unchanged" );
|
||||
}
|
||||
|
||||
// must be after the artifact is installed
|
||||
|
|
Loading…
Reference in New Issue