- Use bndlib 1.15.0 instead of bnd, for parsing annotations.
- Don't use anymore biz.aQute maven repository anymore.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1074944 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/annotation/pom.xml b/dependencymanager/annotation/pom.xml
index a306d14..6fb3e7a 100644
--- a/dependencymanager/annotation/pom.xml
+++ b/dependencymanager/annotation/pom.xml
@@ -37,7 +37,7 @@
<dependency>
<groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
+ <artifactId>bndlib</artifactId>
</dependency>
<dependency>
diff --git a/dependencymanager/pom.xml b/dependencymanager/pom.xml
index 5c8da6c..2565f5a 100644
--- a/dependencymanager/pom.xml
+++ b/dependencymanager/pom.xml
@@ -106,8 +106,8 @@
<dependency>
<groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
- <version>0.0.401</version>
+ <artifactId>bndlib</artifactId>
+ <version>1.15.0</version>
</dependency>
<dependency>
@@ -198,12 +198,6 @@
<name>Java.net Maven 2 Repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
-
- <repository>
- <id>maven2-repository.biz.aQute</id>
- <name>aQute SARL Maven 2 Repository</name>
- <url>http://www.aqute.biz/repo</url>
- </repository>
</repositories>
<scm>
diff --git a/dependencymanager/test/pom.xml b/dependencymanager/test/pom.xml
index 9770e62..df7d9cf 100644
--- a/dependencymanager/test/pom.xml
+++ b/dependencymanager/test/pom.xml
@@ -52,12 +52,10 @@
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
-
<dependency>
<groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
+ <artifactId>bndlib</artifactId>
</dependency>
-
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java
index af964ce..9c28af7 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java
+++ b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java
@@ -15,16 +15,19 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-*/
+ */
package org.apache.felix.dm.test;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.net.URL;
+import java.util.HashSet;
import java.util.Properties;
-import aQute.bnd.main.bnd;
+import aQute.lib.osgi.Analyzer;
+import aQute.lib.osgi.Builder;
+import aQute.lib.osgi.Jar;
/**
* Helper used to generate a bundle dynamically.
@@ -74,12 +77,13 @@
try
{
// Check if the system tmp dir exists
-
+
File tmp = new File(System.getProperty("java.io.tmpdir"));
- if (tmp != null && ! tmp.exists()) {
+ if (tmp != null && !tmp.exists())
+ {
tmp.mkdirs();
}
-
+
// Deduce the classpath from Export-Package, or Private-Package headers.
String pkg = _directives.getProperty("Export-Package");
@@ -89,8 +93,7 @@
}
if (pkg == null)
{
- throw new IllegalArgumentException(
- "You must either specify a Private-Package, or an Export-Package directive");
+ throw new IllegalArgumentException("You must either specify a Private-Package, or an Export-Package directive");
}
String classpath = getClassPath(pkg);
@@ -131,9 +134,7 @@
// Launch Bnd in order to generate our tiny test bundle.
- bnd bnd = new bnd();
- bnd.main(new String[] { "-failok", "build", "-noeclipse", "-classpath", classpath,
- "-output", output.getPath(), directives.getPath() });
+ buildWithBnd(_directives, classpath, output);
// Return the URL of the generated bundle, as a String.
@@ -152,6 +153,22 @@
}
/**
+ * Invoke Bnd builder for generating the target tiny bundle.
+ */
+ private void buildWithBnd(Properties directives, String classpath, File output)
+ throws Exception
+ {
+ Builder builder = new Builder();
+ builder.setProperty(Analyzer.FAIL_OK, "true");
+ builder.setProperties(directives);
+ builder.setClasspath(new String[] { classpath });
+ Jar jar = builder.build();
+ jar.setName(output.getName());
+ jar.write(output);
+ builder.close();
+ }
+
+ /**
* Gets the bundle classpath, where the bundle classes will be collected.
* @param pkg either an exported package, or a private package.
* @return the bundle classpath