From: Jakub Adam <jakub.adam@ktknet.cz>
Date: Wed, 28 Mar 2012 22:20:33 +0200
Subject: generate-osgi-metadata

---
 httpclient/pom.xml |   67 ++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/httpclient/pom.xml b/httpclient/pom.xml
index 4ce1cab..ffaaa0d 100644
--- a/httpclient/pom.xml
+++ b/httpclient/pom.xml
@@ -108,13 +108,11 @@
       </plugin>
       <plugin>
         <artifactId>maven-jar-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test-jar</goal>
-            </goals>
-          </execution>
-        </executions>
+        <configuration>
+          <archive>
+            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+          </archive>
+        </configuration>
       </plugin>
       <plugin>
         <groupId>com.atlassian.maven.plugins</groupId>
@@ -134,6 +132,61 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>2.3.5</version>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <id>bundle-manifest</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>manifest</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <instructions>
+            <Bundle-Name>Apache ${project.name}</Bundle-Name>
+            <Bundle-SymbolicName>${project.groupId}.httpclient</Bundle-SymbolicName>
+            <Bundle-Version>${debian.originalVersion}</Bundle-Version>
+            <_exportcontents>
+            org.apache.http.auth.*;version=${debian.originalVersion},
+            org.apache.http.cookie.*;version=${debian.originalVersion},
+            org.apache.http.conn.*;version=${debian.originalVersion},
+            org.apache.http.client.*;version=${debian.originalVersion},
+            org.apache.http.entity.mime.*;version=${debian.originalVersion},
+            org.apache.http.impl.auth.*;version=${debian.originalVersion},
+            org.apache.http.impl.cookie.*;version=${debian.originalVersion},
+            org.apache.http.impl.conn.*;version=${debian.originalVersion},
+            org.apache.http.impl.client.*;version=${debian.originalVersion}
+            </_exportcontents>
+            <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
+            <Import-Package>
+            javax.crypto,
+            javax.crypto.spec,
+            javax.net.ssl,javax.security.auth.x500,
+            org.ietf.jgss,
+            org.apache.commons.logging,
+            org.apache.http,
+            org.apache.http.entity,
+            org.apache.http.io,
+            org.apache.http.message,
+            org.apache.http.params,
+            org.apache.http.protocol,
+            org.apache.http.util,
+            org.apache.http.impl,
+            org.apache.http.impl.entity,
+            org.apache.http.impl.io,
+            net.sf.ehcache.*;resolution:=optional,
+            net.spy.memcached.*;resolution:=optional
+            </Import-Package>
+            <!-- Stop the JAVA_1_n_HOME variables from being treated as headers by Bnd -->
+            <_removeheaders>JAVA_1_3_HOME,JAVA_1_4_HOME</_removeheaders>
+          </instructions>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 
