You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2019/09/04 14:23:06 UTC

[sling-slingfeature-maven-plugin] branch feature/SLING-8656_usebndlib-for-version-conversion created (now 9b96f84)

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

kwin pushed a change to branch feature/SLING-8656_usebndlib-for-version-conversion
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git.


      at 9b96f84  SLING-8656 use bndlib for Maven to OSGi version conversion

This branch includes the following new commits:

     new 9b96f84  SLING-8656 use bndlib for Maven to OSGi version conversion

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-slingfeature-maven-plugin] 01/01: SLING-8656 use bndlib for Maven to OSGi version conversion

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/SLING-8656_usebndlib-for-version-conversion
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git

commit 9b96f84c3be37aff7f78434fbaea81051b0143f4
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Wed Sep 4 16:22:54 2019 +0200

    SLING-8656 use bndlib for Maven to OSGi version conversion
---
 pom.xml                                                      |  7 ++++---
 .../java/org/apache/sling/feature/maven/Substitution.java    | 12 ++++++------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0176148..d7763e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -226,10 +226,11 @@
             <version>3.5</version>
             <scope>provided</scope>
         </dependency>
+        <!-- for converting Maven to OSGi versions -->
         <dependency>
-            <groupId>org.apache.maven.shared</groupId>
-            <artifactId>maven-osgi</artifactId>
-            <version>0.2.0</version>
+            <groupId>biz.aQute.bnd</groupId>
+            <artifactId>biz.aQute.bndlib</artifactId>
+            <version>4.2.0</version>
         </dependency>
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
diff --git a/src/main/java/org/apache/sling/feature/maven/Substitution.java b/src/main/java/org/apache/sling/feature/maven/Substitution.java
index 300b866..48ed999 100644
--- a/src/main/java/org/apache/sling/feature/maven/Substitution.java
+++ b/src/main/java/org/apache/sling/feature/maven/Substitution.java
@@ -16,10 +16,11 @@
  */
 package org.apache.sling.feature.maven;
 
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
-import org.apache.maven.shared.osgi.Maven2OsgiConverter;
 import org.codehaus.plexus.interpolation.InterpolationException;
 import org.codehaus.plexus.interpolation.ObjectBasedValueSource;
 import org.codehaus.plexus.interpolation.PrefixAwareRecursionInterceptor;
@@ -28,8 +29,7 @@ import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
 import org.codehaus.plexus.interpolation.RecursionInterceptor;
 import org.codehaus.plexus.interpolation.RegexBasedInterpolator;
 
-import java.util.Collections;
-import java.util.List;
+import aQute.bnd.version.MavenVersion;
 
 public class Substitution {
     public static String replaceMavenVars(MavenProject project, String s) {
@@ -95,7 +95,7 @@ public class Substitution {
             sb.append('.');
             sb.append(dav.getQualifier());
         }
-        final Maven2OsgiConverter converter = new DefaultMaven2OsgiConverter();
-        return converter.getVersion(sb.toString());
+        final MavenVersion mavenVersion = new MavenVersion(sb.toString());
+        return mavenVersion.getOSGiVersion().toString();
     }
 }