You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2007/02/21 08:23:29 UTC

svn commit: r509926 - in /maven/sandbox/plugins/maven-bundle-plugin/src: main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java test/java/org/apache/felix/tools/maven2/bundleplugin/BundlePluginTest.java

Author: carlos
Date: Tue Feb 20 23:23:29 2007
New Revision: 509926

URL: http://svn.apache.org/viewvc?view=rev&rev=509926
Log:
Dated snapshots with major minor and service were not converted properly

Modified:
    maven/sandbox/plugins/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
    maven/sandbox/plugins/maven-bundle-plugin/src/test/java/org/apache/felix/tools/maven2/bundleplugin/BundlePluginTest.java

Modified: maven/sandbox/plugins/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java?view=diff&rev=509926&r1=509925&r2=509926
==============================================================================
--- maven/sandbox/plugins/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java (original)
+++ maven/sandbox/plugins/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java Tue Feb 20 23:23:29 2007
@@ -296,14 +296,13 @@
      osgiVersion = version;
 
      /* check for dated snapshot versions with only major or major and minor */
-     Pattern DATED_SNAPSHOT = Pattern.compile("([0-9])(\\.([0-9]))?\\-([0-9]{8}\\.[0-9]{6}\\-[0-9]*)");
+     Pattern DATED_SNAPSHOT = Pattern.compile("([0-9])(\\.([0-9]))?(\\.([0-9]))?\\-([0-9]{8}\\.[0-9]{6}\\-[0-9]*)");
      m = DATED_SNAPSHOT.matcher(osgiVersion);
      if (m.matches()) {
-         int i = m.groupCount();
          String major = m.group(1);
-         String minor = ( m.group( 3 ) != null ) ? m.group( 3 ) : "0";
-         String service = "0";
-         String qualifier = m.group(4).replaceAll( "-", "_" ).replaceAll( "\\.", "_" );
+         String minor = (m.group(3) != null) ? m.group(3) : "0";
+         String service = (m.group(5) != null) ? m.group(5) : "0";
+         String qualifier = m.group(6).replaceAll( "-", "_" ).replaceAll( "\\.", "_" );
          osgiVersion = major + "." + minor + "." + service + "." + qualifier;
      }
 

Modified: maven/sandbox/plugins/maven-bundle-plugin/src/test/java/org/apache/felix/tools/maven2/bundleplugin/BundlePluginTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-bundle-plugin/src/test/java/org/apache/felix/tools/maven2/bundleplugin/BundlePluginTest.java?view=diff&rev=509926&r1=509925&r2=509926
==============================================================================
--- maven/sandbox/plugins/maven-bundle-plugin/src/test/java/org/apache/felix/tools/maven2/bundleplugin/BundlePluginTest.java (original)
+++ maven/sandbox/plugins/maven-bundle-plugin/src/test/java/org/apache/felix/tools/maven2/bundleplugin/BundlePluginTest.java Tue Feb 20 23:23:29 2007
@@ -89,6 +89,9 @@
 
         osgiVersion = plugin.convertVersionToOsgi( "1-20070119.021432-1" );
         assertEquals( "1.0.0.20070119_021432_1", osgiVersion );
+
+        osgiVersion = plugin.convertVersionToOsgi( "1.4.1-20070217.082013-7" );
+        assertEquals( "1.4.1.20070217_082013_7", osgiVersion );
     }
 
     public void testReadExportedModules()