karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject git commit: [KARAF-2110] Support wrap URL in karaf-maven-plugin
Date Tue, 25 Feb 2014 07:14:19 GMT
Repository: karaf
Updated Branches:
  refs/heads/master e3c87cef0 -> 12da0bee4


[KARAF-2110] Support wrap URL in karaf-maven-plugin


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/12da0bee
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/12da0bee
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/12da0bee

Branch: refs/heads/master
Commit: 12da0bee446834c1fa4fa2363ca635cd5f265671
Parents: e3c87ce
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Tue Feb 25 08:13:37 2014 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Tue Feb 25 08:13:37 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/karaf/tooling/features/MavenUtil.java   | 4 ++--
 .../java/org/apache/karaf/tooling/features/MavenUtilTest.java    | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/12da0bee/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/MavenUtil.java
----------------------------------------------------------------------
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/MavenUtil.java
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/MavenUtil.java
index 46b3783..8785960 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/MavenUtil.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/MavenUtil.java
@@ -43,14 +43,14 @@ public class MavenUtil {
 
     private static final DefaultRepositoryLayout layout = new DefaultRepositoryLayout();
     private static final Pattern aetherPattern = Pattern.compile("([^: ]+):([^: ]+)(:([^:
]*)(:([^: ]+))?)?:([^: ]+)");
-    private static final Pattern mvnPattern = Pattern.compile("mvn:([^/ ]+)/([^/ ]+)/([^/
]*)(/([^/ ]+)(/([^/ ]+))?)?");
+    private static final Pattern mvnPattern = Pattern.compile("(?:wrap:)?mvn:([^/ ]+)/([^/
]+)/([^/\\$ ]*)(/([^/\\$ ]+)(/([^/\\$ ]+))?)?(\\$.+)?");
 
     /**
      * Convert PAX URL mvn format to aether coordinate format.
      * N.B. we do not handle repository-url in mvn urls.
      * N.B. version is required in mvn urls.
      *
-     * @param name PAX URL mvn format: mvn-uri := 'mvn:' [ repository-url '!' ] group-id
'/' artifact-id [ '/' [version] [ '/' [type] [ '/' classifier ] ] ] ]
+     * @param name PAX URL mvn format: mvn-uri := [ 'wrap:' ] 'mvn:' [ repository-url '!'
] group-id '/' artifact-id [ '/' [version] [ '/' [type] [ '/' classifier ] ] ] ]
      * @return aether coordinate format: <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
      */
     static String mvnToAether(String name) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/12da0bee/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/MavenUtilTest.java
----------------------------------------------------------------------
diff --git a/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/MavenUtilTest.java
b/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/MavenUtilTest.java
index 61b4347..046e332 100644
--- a/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/MavenUtilTest.java
+++ b/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/MavenUtilTest.java
@@ -37,6 +37,9 @@ public class MavenUtilTest {
         assertEquals("org.foo:org.foo.bar:1.0-SNAPSHOT", mvnToAether("mvn:org.foo/org.foo.bar/1.0-SNAPSHOT"));
         assertEquals("org.foo:org.foo.bar:kar:1.0-SNAPSHOT", mvnToAether("mvn:org.foo/org.foo.bar/1.0-SNAPSHOT/kar"));
         assertEquals("org.foo:org.foo.bar:xml:features:1.0-SNAPSHOT", mvnToAether("mvn:org.foo/org.foo.bar/1.0-SNAPSHOT/xml/features"));
+        assertEquals("org.foo:org.foo.bar:1.0-SNAPSHOT", mvnToAether("wrap:mvn:org.foo/org.foo.bar/1.0-SNAPSHOT"));
+        assertEquals("org.foo:org.foo.bar:kar:1.0-SNAPSHOT", mvnToAether("wrap:mvn:org.foo/org.foo.bar/1.0-SNAPSHOT/kar"));
+        assertEquals("org.foo:org.foo.bar:xml:features:1.0-SNAPSHOT", mvnToAether("wrap:mvn:org.foo/org.foo.bar/1.0-SNAPSHOT/xml/features"));
     }
 
     @Test


Mime
View raw message