You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2019/08/07 17:45:52 UTC

[maven-dependency-plugin] 01/01: WIP - MDEP-655

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch MDEP-655
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit b2d07974229a78f7978eb6b654de551288a38e96
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Aug 7 18:47:52 2019 +0200

    WIP - MDEP-655
---
 .../dependency/utils/filters/DestFileFilter.java   |  4 ++--
 .../fromConfiguration/TestUnpackMojo.java          | 23 +++++++++++-----------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java b/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java
index 8191a12..0801210 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java
@@ -301,8 +301,8 @@ public class DestFileFilter
     }
 
     /**
-     * Using simply {@code File.getLastModified} will return sometime a wrong value see JDK bug for details.
-     * <p>
+     * Using simply {@code File.getLastModified} will return sometimes a wrong value see JDK bug for details.
+     *
      * https://bugs.openjdk.java.net/browse/JDK-8177809
      *
      * @param file {@link File}
diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestUnpackMojo.java b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestUnpackMojo.java
index 52656b3..c9ba0eb 100644
--- a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestUnpackMojo.java
+++ b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestUnpackMojo.java
@@ -19,14 +19,6 @@ package org.apache.maven.plugins.dependency.fromConfiguration;
  * under the License.    
  */
 
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
 import org.apache.commons.lang.time.DateFormatUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.versioning.VersionRange;
@@ -40,6 +32,14 @@ import org.apache.maven.project.MavenProject;
 import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
 import org.sonatype.aether.util.DefaultRepositorySystemSession;
 
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
 public class TestUnpackMojo
     extends AbstractDependencyMojoTestCase
 {
@@ -587,11 +587,12 @@ public class TestUnpackMojo
                 + ": should be different", markerLastModifiedMillis != unpackedFileLastModifiedMillis );
     }
 
-    private void displayFile(String description, File file) throws IOException
+    private void displayFile( String description, File file ) throws IOException
     {
         long toMillis = Files.getLastModifiedTime( file.toPath() ).toMillis();
-        System.out.println( description + ' ' + DateFormatUtils.ISO_DATETIME_FORMAT.format( file.lastModified() ) + ' '
-                + file.getPath().substring( getBasedir().length() ) );
+        System.out.println( description + ' ' + DateFormatUtils.ISO_DATETIME_FORMAT.format(
+                file.lastModified() ) + ' ' + toMillis + ' ' + file.getPath().substring(
+                getBasedir().length() ) );
     }
 
     public void assertUnpacked( ArtifactItem item, boolean overWrite )