patch from David Jencks for feature request #316321
diff --git a/archive/asm-all.bnd b/archive/asm-all.bnd
new file mode 100644
index 0000000..b654794
--- /dev/null
+++ b/archive/asm-all.bnd
@@ -0,0 +1,60 @@
+###############################################################################
+#ASM: a very small and fast Java bytecode manipulation framework
+#Copyright (c) 2000-2011 INRIA, France Telecom
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#1. Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#3. Neither the name of the copyright holders nor the names of its
+#   contributors may be used to endorse or promote products derived from
+#   this software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+#THE POSSIBILITY OF SUCH DAMAGE.
+###############################################################################
+
+
+Implementation-Title:  ASM all classes
+Implementation-Version: ${product.artifact}
+Implementation-Vendor: France Telecom R&D
+
+Bundle-Name: ASM all classes with debug info
+Bundle-Vendor: France Telecom R&D
+Bundle-Version: ${product.artifact}
+Bundle-DocURL:  http://asm.objectweb.org
+Bundle-SymbolicName: org.objectweb.asm.all
+
+Export-Package: \
+  !org.objectweb.asm.optimizer.*,\
+  org.objectweb.asm.*;version=${product.artifact}
+
+Import-Package: \
+  javax.xml.transform.*;resolution:="optional",\
+  org.xml.sax.*;resolution:="optional"
+
+Bundle-RequiredExecutionEnvironment: J2SE-1.3
+
+-removeheaders:\
+  ANNV,\
+  DSTAMP,\
+  FRAMESV,\
+  RESIZEV,\
+  SIGV,\
+  TODAY,\
+  TSTAMP,\
+  WRITERV
diff --git a/archive/asm-all.xml b/archive/asm-all.xml
index 382a53f..3d82865 100644
--- a/archive/asm-all.xml
+++ b/archive/asm-all.xml
@@ -34,25 +34,14 @@
 
   <target name="build-jar">
     <mkdir dir="${out.dist.lib}/all"/>
-    <jar jarfile="${out.dist.lib}/all/${ant.project.name}-${product.artifact}.jar"
-         basedir="${out.build}">
-      <include name="org/objectweb/asm/**/*.class"/>
-      <exclude name="org/objectweb/asm/optimizer/*.class"/>
-      <manifest>
-        <attribute name="Implementation-Title" value="ASM all classes"/>
-        <attribute name="Implementation-Version" value="${product.artifact}"/> 
-        <attribute name="Implementation-Vendor" value="France Telecom R&amp;D"/>
-
-        <attribute name="Bundle-ManifestVersion" value="2"/>
-        <attribute name="Bundle-Name"      value="ASM all classes"/>
-        <attribute name="Bundle-Vendor"    value="France Telecom R&amp;D"/>
-        <attribute name="Bundle-Version"   value="${product.artifact}"/>
-        <attribute name="Bundle-DocURL"    value="http://asm.objectweb.org"/>
-        <attribute name="Bundle-SymbolicName" value="org.objectweb.asm.all"/>
-        <attribute name="Export-Package" value="org.objectweb.asm;version=${product.artifact},org.objectweb.asm.signature;version=${product.artifact},org.objectweb.asm.commons;version=${product.artifact},org.objectweb.asm.tree;version=${product.artifact},org.objectweb.asm.tree.analysis;version=${product.artifact},org.objectweb.asm.util;version=${product.artifact},org.objectweb.asm.xml;version=${product.artifact}"/>
-        <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.3"/>
-      </manifest>
-    </jar>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${config}/biz.aQute.bnd.jar"/>
+    <bnd
+            classpath="${out.build}"
+            eclipse="true"
+            failok="false"
+            exceptions="true"
+            files="archive/asm-all.bnd"
+            output="${out.dist.lib}/all/${ant.project.name}-${product.artifact}.jar"/>
 
     <copy file="${archive}/asm-all.pom" toFile="${out.dist.lib}/all/${ant.project.name}-${product.artifact}.pom"/>
     <replace file="${out.dist.lib}/all/${ant.project.name}-${product.artifact}.pom" token="@product.name@" value="${ant.project.name}"/>
diff --git a/archive/asm-analysis.bnd b/archive/asm-analysis.bnd
new file mode 100644
index 0000000..a05c03b
--- /dev/null
+++ b/archive/asm-analysis.bnd
@@ -0,0 +1,58 @@
+###############################################################################
+#ASM: a very small and fast Java bytecode manipulation framework
+#Copyright (c) 2000-2011 INRIA, France Telecom
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#1. Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#3. Neither the name of the copyright holders nor the names of its
+#   contributors may be used to endorse or promote products derived from
+#   this software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+#THE POSSIBILITY OF SUCH DAMAGE.
+###############################################################################
+
+
+Implementation-Title:  ASM static code analysis framework
+Implementation-Version: ${product.artifact}
+Implementation-Vendor: France Telecom R&D
+
+Bundle-Name: ASM static code analysis framework
+Bundle-Vendor: France Telecom R&D
+Bundle-Version: ${product.artifact}
+Bundle-DocURL:  http://asm.objectweb.org
+Bundle-SymbolicName: org.objectweb.asm.analysis
+
+Export-Package: \
+  org.objectweb.asm.tree.analysis;version=${product.artifact}
+
+Import-Package: \
+  org.objectweb.asm.*;version:="[${product.artifact},${product.artifact}]"
+
+Bundle-RequiredExecutionEnvironment: J2SE-1.3
+
+-removeheaders:\
+  ANNV,\
+  DSTAMP,\
+  FRAMESV,\
+  RESIZEV,\
+  SIGV,\
+  TODAY,\
+  TSTAMP,\
+  WRITERV
diff --git a/archive/asm-analysis.xml b/archive/asm-analysis.xml
index 52d0804..c3ecd65 100644
--- a/archive/asm-analysis.xml
+++ b/archive/asm-analysis.xml
@@ -33,15 +33,14 @@
   <target name="dist" depends="build-jar,build-snapshot"/>
 
   <target name="build-jar">
-    <jar jarfile="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"
-         basedir="${out.build}">
-      <include name="org/objectweb/asm/tree/analysis/*.class"/>
-      <manifest>
-        <attribute name="Implementation-Title" value="ASM static code analysis framework"/>
-        <attribute name="Implementation-Version" value="${product.artifact}"/> 
-        <attribute name="Implementation-Vendor" value="France Telecom R&amp;D"/>
-      </manifest>
-    </jar>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${config}/biz.aQute.bnd.jar"/>
+    <bnd
+            classpath="${out.build}"
+            eclipse="true"
+            failok="false"
+            exceptions="true"
+            files="archive/asm-analysis.bnd"
+            output="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"/>
 
     <copy file="${archive}/asm-analysis.pom" toFile="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom"/>
     <replace file="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom" token="@product.name@" value="${ant.project.name}"/>
diff --git a/archive/asm-commons.bnd b/archive/asm-commons.bnd
new file mode 100644
index 0000000..fde93b2
--- /dev/null
+++ b/archive/asm-commons.bnd
@@ -0,0 +1,58 @@
+###############################################################################
+#ASM: a very small and fast Java bytecode manipulation framework
+#Copyright (c) 2000-2011 INRIA, France Telecom
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#1. Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#3. Neither the name of the copyright holders nor the names of its
+#   contributors may be used to endorse or promote products derived from
+#   this software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+#THE POSSIBILITY OF SUCH DAMAGE.
+###############################################################################
+
+
+Implementation-Title:  ASM commons classes
+Implementation-Version: ${product.artifact}
+Implementation-Vendor: France Telecom R&D
+
+Bundle-Name: ASM commons classes
+Bundle-Vendor: France Telecom R&D
+Bundle-Version: ${product.artifact}
+Bundle-DocURL:  http://asm.objectweb.org
+Bundle-SymbolicName: org.objectweb.asm.commons
+
+Export-Package: \
+  org.objectweb.asm.commons;version=${product.artifact}
+
+Import-Package: \
+  org.objectweb.asm.*;version:="[${product.artifact},${product.artifact}]"
+
+Bundle-RequiredExecutionEnvironment: J2SE-1.3
+
+-removeheaders:\
+  ANNV,\
+  DSTAMP,\
+  FRAMESV,\
+  RESIZEV,\
+  SIGV,\
+  TODAY,\
+  TSTAMP,\
+  WRITERV
diff --git a/archive/asm-commons.xml b/archive/asm-commons.xml
index 1f8a44b..95129a7 100644
--- a/archive/asm-commons.xml
+++ b/archive/asm-commons.xml
@@ -33,15 +33,14 @@
   <target name="dist" depends="build-jar,build-snapshot"/>
 
   <target name="build-jar">
-    <jar jarfile="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"
-         basedir="${out.build}">
-      <include name="org/objectweb/asm/commons/*.class"/>
-      <manifest>
-        <attribute name="Implementation-Title" value="ASM commons"/>
-        <attribute name="Implementation-Version" value="${product.artifact}"/> 
-        <attribute name="Implementation-Vendor" value="France Telecom R&amp;D"/>
-      </manifest>
-    </jar>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${config}/biz.aQute.bnd.jar"/>
+    <bnd
+            classpath="${out.build}"
+            eclipse="true"
+            failok="false"
+            exceptions="true"
+            files="archive/asm-commons.bnd"
+            output="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"/>
 
     <copy file="${archive}/asm-commons.pom" toFile="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom"/>
     <replace file="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom" token="@product.name@" value="${ant.project.name}"/>
diff --git a/archive/asm-debug-all.bnd b/archive/asm-debug-all.bnd
index c042132..194e6a1 100644
--- a/archive/asm-debug-all.bnd
+++ b/archive/asm-debug-all.bnd
@@ -37,7 +37,7 @@
 Bundle-Vendor: France Telecom R&D
 Bundle-Version: ${product.artifact}
 Bundle-DocURL:  http://asm.objectweb.org
-Bundle-SymbolicName: org.objectweb.asm.all
+Bundle-SymbolicName: org.objectweb.asm.all.debug
 
 Export-Package: \
   !org.objectweb.asm.optimizer.*,\
diff --git a/archive/asm-tree.bnd b/archive/asm-tree.bnd
new file mode 100644
index 0000000..d869914
--- /dev/null
+++ b/archive/asm-tree.bnd
@@ -0,0 +1,58 @@
+###############################################################################
+#ASM: a very small and fast Java bytecode manipulation framework
+#Copyright (c) 2000-2011 INRIA, France Telecom
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#1. Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#3. Neither the name of the copyright holders nor the names of its
+#   contributors may be used to endorse or promote products derived from
+#   this software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+#THE POSSIBILITY OF SUCH DAMAGE.
+###############################################################################
+
+
+Implementation-Title:  ASM Tree class visitor
+Implementation-Version: ${product.artifact}
+Implementation-Vendor: France Telecom R&D
+
+Bundle-Name: ASM Tree class visitor
+Bundle-Vendor: France Telecom R&D
+Bundle-Version: ${product.artifact}
+Bundle-DocURL:  http://asm.objectweb.org
+Bundle-SymbolicName: org.objectweb.asm.tree
+
+Export-Package: \
+  org.objectweb.asm.tree;version=${product.artifact}
+
+Import-Package: \
+  org.objectweb.asm.*;version:="[${product.artifact},${product.artifact}]"
+
+Bundle-RequiredExecutionEnvironment: J2SE-1.3
+
+-removeheaders:\
+  ANNV,\
+  DSTAMP,\
+  FRAMESV,\
+  RESIZEV,\
+  SIGV,\
+  TODAY,\
+  TSTAMP,\
+  WRITERV
diff --git a/archive/asm-tree.xml b/archive/asm-tree.xml
index 0d2772b..527a9ef 100644
--- a/archive/asm-tree.xml
+++ b/archive/asm-tree.xml
@@ -33,15 +33,14 @@
   <target name="dist" depends="build-jar,build-snapshot"/>
 
   <target name="build-jar">
-    <jar jarfile="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"
-         basedir="${out.build}">
-      <include name="org/objectweb/asm/tree/*.class"/>
-      <manifest>
-        <attribute name="Implementation-Title" value="ASM Tree class visitor"/>
-        <attribute name="Implementation-Version" value="${product.artifact}"/> 
-        <attribute name="Implementation-Vendor" value="France Telecom R&amp;D"/>
-      </manifest>
-    </jar>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${config}/biz.aQute.bnd.jar"/>
+    <bnd
+            classpath="${out.build}"
+            eclipse="true"
+            failok="false"
+            exceptions="true"
+            files="archive/asm-tree.bnd"
+            output="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"/>
 
     <copy file="${archive}/asm-tree.pom" toFile="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom"/>
     <replace file="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom" token="@product.name@" value="${ant.project.name}"/>
diff --git a/archive/asm-util.bnd b/archive/asm-util.bnd
new file mode 100644
index 0000000..dfc4c99
--- /dev/null
+++ b/archive/asm-util.bnd
@@ -0,0 +1,58 @@
+###############################################################################
+#ASM: a very small and fast Java bytecode manipulation framework
+#Copyright (c) 2000-2011 INRIA, France Telecom
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#1. Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#3. Neither the name of the copyright holders nor the names of its
+#   contributors may be used to endorse or promote products derived from
+#   this software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+#THE POSSIBILITY OF SUCH DAMAGE.
+###############################################################################
+
+
+Implementation-Title:  ASM Utilities
+Implementation-Version: ${product.artifact}
+Implementation-Vendor: France Telecom R&D
+
+Bundle-Name: ASM Utilities
+Bundle-Vendor: France Telecom R&D
+Bundle-Version: ${product.artifact}
+Bundle-DocURL:  http://asm.objectweb.org
+Bundle-SymbolicName: org.objectweb.asm.util
+
+Export-Package: \
+  org.objectweb.asm.util;version=${product.artifact}
+
+Import-Package: \
+  org.objectweb.asm.*;version:="[${product.artifact},${product.artifact}]"
+
+Bundle-RequiredExecutionEnvironment: J2SE-1.3
+
+-removeheaders:\
+  ANNV,\
+  DSTAMP,\
+  FRAMESV,\
+  RESIZEV,\
+  SIGV,\
+  TODAY,\
+  TSTAMP,\
+  WRITERV
diff --git a/archive/asm-util.xml b/archive/asm-util.xml
index 3ab3a65..b20b783 100644
--- a/archive/asm-util.xml
+++ b/archive/asm-util.xml
@@ -33,15 +33,14 @@
   <target name="dist" depends="build-jar,build-snapshot"/>
 
   <target name="build-jar">
-    <jar jarfile="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"
-         basedir="${out.build}">
-      <include name="org/objectweb/asm/util/**/*.class"/>
-      <manifest>
-        <attribute name="Implementation-Title" value="ASM Utilities"/>
-        <attribute name="Implementation-Version" value="${product.artifact}"/> 
-        <attribute name="Implementation-Vendor" value="France Telecom R&amp;D"/>
-      </manifest>
-    </jar>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${config}/biz.aQute.bnd.jar"/>
+    <bnd
+            classpath="${out.build}"
+            eclipse="true"
+            failok="false"
+            exceptions="true"
+            files="archive/asm-util.bnd"
+            output="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"/>
 
     <copy file="${archive}/asm-util.pom" toFile="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom"/>
     <replace file="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom" token="@product.name@" value="${ant.project.name}"/>
diff --git a/archive/asm-xml.bnd b/archive/asm-xml.bnd
new file mode 100644
index 0000000..03e7439
--- /dev/null
+++ b/archive/asm-xml.bnd
@@ -0,0 +1,61 @@
+###############################################################################
+#ASM: a very small and fast Java bytecode manipulation framework
+#Copyright (c) 2000-2011 INRIA, France Telecom
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#1. Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#3. Neither the name of the copyright holders nor the names of its
+#   contributors may be used to endorse or promote products derived from
+#   this software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+#THE POSSIBILITY OF SUCH DAMAGE.
+###############################################################################
+
+
+Implementation-Title:  ASM XML classes
+Implementation-Version: ${product.artifact}
+Implementation-Vendor: Eugene Kuleshov
+Class-Path: asm-${product.artifact}.jar asm-util-${product.artifact}.jar asm-attrs-${product.artifact}.jar
+Main-Class: org.objectweb.asm.xml.Processor
+
+Bundle-Name: ASM xml classes
+Bundle-Vendor: France Telecom R&D
+Bundle-Version: ${product.artifact}
+Bundle-DocURL:  http://asm.objectweb.org
+Bundle-SymbolicName: org.objectweb.asm.xml
+
+Export-Package: \
+  org.objectweb.asm.xml;version=${product.artifact}
+
+Import-Package: \
+  javax.xml.transform.*;resolution:="optional",\
+  org.xml.sax.*;resolution:="optional"
+
+Bundle-RequiredExecutionEnvironment: J2SE-1.3
+
+-removeheaders:\
+  ANNV,\
+  DSTAMP,\
+  FRAMESV,\
+  RESIZEV,\
+  SIGV,\
+  TODAY,\
+  TSTAMP,\
+  WRITERV
diff --git a/archive/asm-xml.xml b/archive/asm-xml.xml
index 97ebf04..c7a123d 100644
--- a/archive/asm-xml.xml
+++ b/archive/asm-xml.xml
@@ -33,17 +33,14 @@
   <target name="dist" depends="build-jar,build-snapshot"/>
 
   <target name="build-jar">
-    <jar jarfile="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"
-         basedir="${out.build}">
-      <include name="org/objectweb/asm/xml/*.class"/>
-      <manifest>
-        <attribute name="Implementation-Title" value="ASM XML classes"/>
-        <attribute name="Implementation-Version" value="${product.artifact}"/> 
-        <attribute name="Implementation-Vendor" value="Eugene Kuleshov"/>
-        <attribute name="Class-path" value="asm-${product.artifact}.jar asm-util-${product.artifact}.jar asm-attrs-${product.artifact}.jar"/>
-        <attribute name="Main-class" value="org.objectweb.asm.xml.Processor"/>
-      </manifest>
-    </jar>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${config}/biz.aQute.bnd.jar"/>
+    <bnd
+            classpath="${out.build}"
+            eclipse="true"
+            failok="false"
+            exceptions="true"
+            files="archive/asm-xml.bnd"
+            output="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"/>
 
     <copy file="${archive}/asm-xml.pom" toFile="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom"/>
     <replace file="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom" token="@product.name@" value="${ant.project.name}"/>
diff --git a/archive/asm.bnd b/archive/asm.bnd
new file mode 100644
index 0000000..d9abde8
--- /dev/null
+++ b/archive/asm.bnd
@@ -0,0 +1,56 @@
+###############################################################################
+#ASM: a very small and fast Java bytecode manipulation framework
+#Copyright (c) 2000-2011 INRIA, France Telecom
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#1. Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#3. Neither the name of the copyright holders nor the names of its
+#   contributors may be used to endorse or promote products derived from
+#   this software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+#THE POSSIBILITY OF SUCH DAMAGE.
+###############################################################################
+
+
+Implementation-Title:  ASM
+Implementation-Version: ${product.artifact}
+Implementation-Vendor: France Telecom R&D
+
+Bundle-Name: ASM
+Bundle-Vendor: France Telecom R&D
+Bundle-Version: ${product.artifact}
+Bundle-DocURL:  http://asm.objectweb.org
+Bundle-SymbolicName: org.objectweb.asm
+
+Export-Package: \
+  org.objectweb.asm;version=${product.artifact}, \
+  org.objectweb.asm.signature;version=${product.artifact}
+
+Bundle-RequiredExecutionEnvironment: J2SE-1.3
+
+-removeheaders:\
+  ANNV,\
+  DSTAMP,\
+  FRAMESV,\
+  RESIZEV,\
+  SIGV,\
+  TODAY,\
+  TSTAMP,\
+  WRITERV
diff --git a/archive/asm.xml b/archive/asm.xml
index 4ad41ab..47e7b9e 100644
--- a/archive/asm.xml
+++ b/archive/asm.xml
@@ -33,16 +33,14 @@
   <target name="dist" depends="build-jar,build-snapshot"/>
 
   <target name="build-jar">
-    <jar jarfile="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"
-         basedir="${out.build}">
-      <include name="org/objectweb/asm/*.class"/>
-      <include name="org/objectweb/asm/signature/*.class"/>
-      <manifest>
-        <attribute name="Implementation-Title" value="ASM"/>
-        <attribute name="Implementation-Version" value="${product.artifact}"/> 
-        <attribute name="Implementation-Vendor" value="France Telecom R&amp;D"/>
-      </manifest>
-    </jar>
+    <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${config}/biz.aQute.bnd.jar"/>
+    <bnd
+            classpath="${out.build}"
+            eclipse="true"
+            failok="false"
+            exceptions="true"
+            files="archive/asm.bnd"
+            output="${out.dist.lib}/${ant.project.name}-${product.artifact}.jar"/>
 
     <copy file="${archive}/asm.pom" toFile="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom"/>
     <replace file="${out.dist.lib}/${ant.project.name}-${product.artifact}.pom" token="@product.name@" value="${ant.project.name}"/>