1f0da8
From d71aa7acc93b944b159ac63f85d9ba1a566f5a8d Mon Sep 17 00:00:00 2001
1f0da8
From: Mikolaj Izdebski <mizdebsk@redhat.com>
1f0da8
Date: Tue, 29 Jul 2014 09:00:03 +0200
1f0da8
Subject: [PATCH 1/2] Generate different Bundle-SymbolicName for different JARs
1f0da8
1f0da8
---
1f0da8
 pom.xml | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1f0da8
 1 file changed, 55 insertions(+)
1f0da8
1f0da8
diff --git a/pom.xml b/pom.xml
1f0da8
index cdad31c..5707595 100644
1f0da8
--- a/pom.xml
1f0da8
+++ b/pom.xml
1f0da8
@@ -179,6 +179,52 @@ under the License.
1f0da8
   <build>
1f0da8
     <plugins>
1f0da8
 
1f0da8
+      <plugin>
1f0da8
+        <groupId>org.apache.felix</groupId>
1f0da8
+        <artifactId>maven-bundle-plugin</artifactId>
1f0da8
+        <executions>
1f0da8
+          <execution>
1f0da8
+            <id>tests-bundle-manifest</id>
1f0da8
+            <phase>process-classes</phase>
1f0da8
+            <goals>
1f0da8
+              <goal>manifest</goal>
1f0da8
+            </goals>
1f0da8
+            <configuration>
1f0da8
+              <manifestLocation>${project.build.directory}/osgi-tests</manifestLocation>
1f0da8
+              <instructions>
1f0da8
+                <Bundle-SymbolicName>${commons.osgi.symbolicName}.tests</Bundle-SymbolicName>
1f0da8
+              </instructions>
1f0da8
+            </configuration>
1f0da8
+          </execution>
1f0da8
+          <execution>
1f0da8
+            <id>api-bundle-manifest</id>
1f0da8
+            <phase>process-classes</phase>
1f0da8
+            <goals>
1f0da8
+              <goal>manifest</goal>
1f0da8
+            </goals>
1f0da8
+            <configuration>
1f0da8
+              <manifestLocation>${project.build.directory}/osgi-api</manifestLocation>
1f0da8
+              <instructions>
1f0da8
+                <Bundle-SymbolicName>${commons.osgi.symbolicName}.api</Bundle-SymbolicName>
1f0da8
+              </instructions>
1f0da8
+            </configuration>
1f0da8
+          </execution>
1f0da8
+          <execution>
1f0da8
+            <id>adapters-bundle-manifest</id>
1f0da8
+            <phase>process-classes</phase>
1f0da8
+            <goals>
1f0da8
+              <goal>manifest</goal>
1f0da8
+            </goals>
1f0da8
+            <configuration>
1f0da8
+              <manifestLocation>${project.build.directory}/osgi-adapters</manifestLocation>
1f0da8
+              <instructions>
1f0da8
+                <Bundle-SymbolicName>${commons.osgi.symbolicName}.adapters</Bundle-SymbolicName>
1f0da8
+              </instructions>
1f0da8
+            </configuration>
1f0da8
+          </execution>
1f0da8
+        </executions>
1f0da8
+      </plugin>
1f0da8
+
1f0da8
       
1f0da8
         - We want to create four jarfiles from this project: normal, tests, api
1f0da8
         - and adapters. The first two are handled by the normal jar:jar and
1f0da8
@@ -202,6 +248,9 @@ under the License.
1f0da8
             </goals>
1f0da8
             <configuration>
1f0da8
               <jarName>commons-logging</jarName>
1f0da8
+              <archive>
1f0da8
+                <manifestFile>${project.build.directory}/osgi-tests/MANIFEST.MF</manifestFile>
1f0da8
+              </archive>
1f0da8
             </configuration>
1f0da8
           </execution>
1f0da8
 
1f0da8
@@ -213,6 +262,9 @@ under the License.
1f0da8
             </goals>
1f0da8
             <configuration>
1f0da8
               <jarName>${project.artifactId}-api-${project.version}</jarName>
1f0da8
+              <archive>
1f0da8
+                <manifestFile>${project.build.directory}/osgi-api/MANIFEST.MF</manifestFile>
1f0da8
+              </archive>
1f0da8
               <includes>
1f0da8
                 <include>org/apache/commons/logging/*.class</include>
1f0da8
                 <include>org/apache/commons/logging/impl/LogFactoryImpl*.class</include>
1f0da8
@@ -237,6 +289,9 @@ under the License.
1f0da8
             </goals>
1f0da8
             <configuration>
1f0da8
               <jarName>${project.artifactId}-adapters-${project.version}</jarName>
1f0da8
+              <archive>
1f0da8
+                <manifestFile>${project.build.directory}/osgi-adapters/MANIFEST.MF</manifestFile>
1f0da8
+              </archive>
1f0da8
               <includes>
1f0da8
                 <include>org/apache/commons/logging/impl/**.class</include>
1f0da8
                 <include>META-INF/LICENSE.txt</include>
1f0da8
-- 
1f0da8
2.5.5
1f0da8