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