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