Return-Path: Delivered-To: apmail-maven-commits-archive@www.apache.org Received: (qmail 69033 invoked from network); 29 Dec 2009 11:22:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Dec 2009 11:22:16 -0000 Received: (qmail 5614 invoked by uid 500); 29 Dec 2009 11:22:16 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 5511 invoked by uid 500); 29 Dec 2009 11:22:15 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 5502 invoked by uid 99); 29 Dec 2009 11:22:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Dec 2009 11:22:15 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Dec 2009 11:22:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1024223889FD; Tue, 29 Dec 2009 11:21:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r894355 - in /maven/maven-2/branches/maven-2.2.x: ./ maven-artifact-manager/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java Date: Tue, 29 Dec 2009 11:21:48 -0000 To: commits@maven.apache.org From: bentmann@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091229112149.1024223889FD@eris.apache.org> Author: bentmann Date: Tue Dec 29 11:21:48 2009 New Revision: 894355 URL: http://svn.apache.org/viewvc?rev=894355&view=rev Log: [MNG-4368] DefaultArtifactInstaller should only overwrite files if timestamp has changed o Revised to install upon any difference in file timestamp or length Modified: maven/maven-2/branches/maven-2.2.x/ (props changed) maven/maven-2/branches/maven-2.2.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java Propchange: maven/maven-2/branches/maven-2.2.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Dec 29 11:21:48 2009 @@ -5,5 +5,5 @@ /maven/components/branches/maven-2.1.x:751686,767628,767631,768817,768995,769010-769011 /maven/components/trunk:572229,720001,721902,726845,729292,792073 /maven/maven-2/branches/maven-2.2.x-MNG-4347:813112 -/maven/maven-3/trunk:894176 +/maven/maven-3/trunk:894114,894176 /maven/sandbox/branches/maven/MNG-3379:678167 Modified: maven/maven-2/branches/maven-2.2.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java URL: http://svn.apache.org/viewvc/maven/maven-2/branches/maven-2.2.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java?rev=894355&r1=894354&r2=894355&view=diff ============================================================================== --- maven/maven-2/branches/maven-2.2.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java (original) +++ maven/maven-2/branches/maven-2.2.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/installer/DefaultArtifactInstaller.java Tue Dec 29 11:21:48 2009 @@ -93,10 +93,22 @@ 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().info( "Skipped re-installing " + source + " to " + destination + ", seems unchanged" ); + } - FileUtils.copyFileIfModified( source, destination ); - // Now, we'll set the artifact's file to the one installed in the local repository, // to help avoid duplicate copy operations in the deployment step. if ( useArtifactFile )