Fixed the version handling of the plugin to only replace the '-' before
the qualifier and removed the default resources to copy.
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@470518 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tools/maven2/maven-bundle-plugin/pom.xml b/tools/maven2/maven-bundle-plugin/pom.xml
index 7b9dfd2..854e7ac 100644
--- a/tools/maven2/maven-bundle-plugin/pom.xml
+++ b/tools/maven2/maven-bundle-plugin/pom.xml
@@ -2,13 +2,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
<parent>
<artifactId>felix</artifactId>
<groupId>org.apache.felix</groupId>
<version>0.8.0-SNAPSHOT</version>
</parent>
--->
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.felix</groupId>
@@ -22,7 +20,7 @@
</repositories>
<packaging>maven-plugin</packaging>
- <name>Maven Plugin OSGi Bundle</name>
+ <name>Maven Bundle Plugin</name>
<description> provides a maven plugin that allows that builds the jar by
embedding packages from the classpath (wildcarded). Plus a zillion
other features. See http://www.aqute.biz/php/tools/bnd.php
@@ -33,7 +31,7 @@
<dependency>
<groupId>biz.aQute</groupId>
<artifactId>bnd</artifactId>
- <version>0.0.95</version>
+ <version>0.0.96</version>
</dependency>
<dependency>
<groupId>junit</groupId>
diff --git a/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java b/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
index 5c1a379..997e3ca 100644
--- a/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
+++ b/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
@@ -21,6 +21,7 @@
import java.io.*;
import java.lang.reflect.*;
import java.util.*;
+import java.util.regex.*;
import java.util.zip.ZipException;
import org.apache.maven.artifact.Artifact;
@@ -90,7 +91,12 @@
properties.put(Analyzer.BUNDLE_SYMBOLICNAME, bsn);
properties.put(Analyzer.IMPORT_PACKAGE, "*");
properties.put(Analyzer.EXPORT_PACKAGE, bsn + ".*");
- String version = project.getVersion().replace('-', '.');
+ String version = project.getVersion();
+ Pattern P_VERSION = Pattern.compile("([0-9]+(\\.[0-9])*)-(.*)");
+ Matcher m = P_VERSION.matcher(version);
+ if (m.matches()) {
+ version = m.group(1) + "." + m.group(3);
+ }
properties.put(Analyzer.BUNDLE_VERSION, version);
header(properties, Analyzer.BUNDLE_DESCRIPTION, project
.getDescription());
@@ -99,7 +105,6 @@
header(properties, Analyzer.BUNDLE_NAME, project.getName());
header(properties, Analyzer.BUNDLE_VENDOR, project
.getOrganization());
- header(properties, Analyzer.INCLUDE_RESOURCE, "src/main/resources");
properties.putAll(project.getProperties());
properties.putAll(project.getModel().getProperties());