maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject [maven] 01/01: [MNG-6403] Artifact#VERSION_FILE_PATTERN does not escape period between date and time
Date Sun, 06 May 2018 20:05:21 GMT
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MNG-6403
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 72f78042e07b093a685e57505ff8b1f0a98c30a7
Author: kevin-canadian <kevin.canadian@gmail.com>
AuthorDate: Fri Apr 7 14:51:42 2017 +0200

    [MNG-6403] Artifact#VERSION_FILE_PATTERN does not escape period between date and time
    
    This closes #112
---
 maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java    | 2 +-
 .../src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java      | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java b/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java
index 9546433..377935d 100644
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java
@@ -46,7 +46,7 @@ public interface Artifact
 
     String SNAPSHOT_VERSION = "SNAPSHOT";
 
-    Pattern VERSION_FILE_PATTERN = Pattern.compile( "^(.*)-([0-9]{8}.[0-9]{6})-([0-9]+)$"
);
+    Pattern VERSION_FILE_PATTERN = Pattern.compile( "^(.*)-([0-9]{8}\\.[0-9]{6})-([0-9]+)$"
);
 
     // TODO into artifactScope handler
 
diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java
index a80f337..333f636 100644
--- a/maven-compat/src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java
@@ -49,6 +49,7 @@ public class ArtifactUtilsTest
         assertEquals( true, ArtifactUtils.isSnapshot( "1.2.3-SNAPSHOT" ) );
         assertEquals( true, ArtifactUtils.isSnapshot( "1.2.3-snapshot" ) );
         assertEquals( true, ArtifactUtils.isSnapshot( "1.2.3-20090413.094722-2" ) );
+        assertEquals( false, ArtifactUtils.isSnapshot( "1.2.3-20090413X094722-2"));
     }
 
     public void testToSnapshotVersion()
@@ -56,6 +57,7 @@ public class ArtifactUtilsTest
         assertEquals( "1.2.3", ArtifactUtils.toSnapshotVersion( "1.2.3" ) );
         assertEquals( "1.2.3-SNAPSHOT", ArtifactUtils.toSnapshotVersion( "1.2.3-SNAPSHOT"
) );
         assertEquals( "1.2.3-SNAPSHOT", ArtifactUtils.toSnapshotVersion( "1.2.3-20090413.094722-2"
) );
+        assertEquals( "1.2.3-20090413X094722-2", ArtifactUtils.toSnapshotVersion( "1.2.3-20090413X094722-2"
) );
     }
 
     /**

-- 
To stop receiving notification emails like this one, please contact
michaelo@apache.org.

Mime
View raw message