You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/04/16 04:03:24 UTC

svn commit: r1587777 - in /logging/log4j/log4j2/trunk: log4j-1.2-api/pom.xml log4j-api/pom.xml pom.xml

Author: mattsicker
Date: Wed Apr 16 02:03:24 2014
New Revision: 1587777

URL: http://svn.apache.org/r1587777
Log:
Add improved OSGi support to log4j-api and api-1.2

  - Bundles are just a normal JAR with OSGi manifest information added.

Modified:
    logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml
    logging/log4j/log4j2/trunk/log4j-api/pom.xml
    logging/log4j/log4j2/trunk/pom.xml

Modified: logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml?rev=1587777&r1=1587776&r2=1587777&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml (original)
+++ logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml Wed Apr 16 02:03:24 2014
@@ -24,7 +24,7 @@
     <relativePath>../</relativePath>
   </parent>
   <artifactId>log4j-1.2-api</artifactId>
-  <packaging>jar</packaging>
+  <packaging>bundle</packaging>
   <name>Apache Log4j 1.x Compatibility API</name>
   <description>The Log4j 1.x Compatibility API</description>
   <properties>
@@ -43,7 +43,7 @@
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.framework</artifactId>
       <scope>test</scope>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.eclipse.osgi</groupId>
       <artifactId>org.eclipse.osgi</artifactId>
@@ -93,6 +93,16 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Export-Package>org.apache.log4j.*</Export-Package>
+            <Fragment-Host>org.apache.logging.log4j.api;bundle-version=${project.version.osgi}</Fragment-Host>
+          </instructions>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
   <reporting>

Modified: logging/log4j/log4j2/trunk/log4j-api/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/pom.xml?rev=1587777&r1=1587776&r2=1587777&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/pom.xml (original)
+++ logging/log4j/log4j2/trunk/log4j-api/pom.xml Wed Apr 16 02:03:24 2014
@@ -24,7 +24,7 @@
     <relativePath>../</relativePath>
   </parent>
   <artifactId>log4j-api</artifactId>
-  <packaging>jar</packaging>
+  <packaging>bundle</packaging>
   <name>Apache Log4j API</name>
   <description>The Log4j API</description>
   <properties>
@@ -89,6 +89,15 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Export-Package>*</Export-Package>
+          </instructions>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
   <reporting>

Modified: logging/log4j/log4j2/trunk/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/pom.xml?rev=1587777&r1=1587776&r2=1587777&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/pom.xml (original)
+++ logging/log4j/log4j2/trunk/pom.xml Wed Apr 16 02:03:24 2014
@@ -161,6 +161,7 @@
     <flumeVersion>1.4.0</flumeVersion>
     <disruptor.version>3.2.0</disruptor.version>
     <!-- Configuration properties for the OSGi maven-bundle-plugin -->
+    <project.version.osgi>2.0.0</project.version.osgi>
     <osgi.symbolicName>org.apache.logging.${project.artifactId}</osgi.symbolicName>
     <osgi.export>org.apache.logging.log4j.*;version=${project.version};-noimport:=true</osgi.export>
     <osgi.import>*</osgi.import>
@@ -173,7 +174,7 @@
     <rat.plugin.version>0.10</rat.plugin.version>
     <pdf.plugin.version>1.2</pdf.plugin.version>
     <cobertura.plugin.version>2.5.2</cobertura.plugin.version>
-    <manifestfile>target/osgi/MANIFEST.MF</manifestfile>
+    <manifestfile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestfile>
     <maven.compile.source>1.6</maven.compile.source>
     <maven.compile.target>1.6</maven.compile.target>
     <docLabel>Site Documentation</docLabel>
@@ -588,6 +589,20 @@
           <artifactId>maven-bundle-plugin</artifactId>
           <version>2.4.0</version>
           <inherited>true</inherited>
+          <extensions>true</extensions>
+          <executions>
+            <execution>
+              <goals>
+                <goal>manifest</goal>
+              </goals>
+              <phase>process-classes</phase>
+            </execution>
+          </executions>
+          <configuration>
+            <instructions>
+              <Bundle-Version>${project.version.osgi}</Bundle-Version>
+            </instructions>
+          </configuration>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
@@ -752,43 +767,7 @@
         </executions>
       </plugin> -->
 
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <!--
-            dummy entry to stop bundle plugin from picking up jar config and reporting
-            WARNING: Duplicate name in Manifest
-            See http://markmail.org/message/mpkl24wk3jrjhhjg
-          -->
-          <archive>
-            <forced>true</forced>
-          </archive>
-          <excludeDependencies>true</excludeDependencies>
-          <manifestLocation>target/osgi</manifestLocation>
-          <instructions>
-            <!-- stops the "uses" clauses being added to "Export-Package" manifest entry -->
-            <_nouses>true</_nouses>
-            <!-- Stop the JAVA_1_n_HOME variables from being treated as headers by Bnd -->
-            <_removeheaders>JAVA_1_3_HOME,JAVA_1_4_HOME,JAVA_1_5_HOME,JAVA_1_6_HOME,JAVA_1_7_HOME,JAVA_1_8_HOME,JAVA_1_9_HOME</_removeheaders>
-            <Bundle-SymbolicName>${osgi.symbolicName}</Bundle-SymbolicName>
-            <Export-Package>${osgi.export}</Export-Package>
-            <Private-Package>${osgi.private}</Private-Package>
-            <Import-Package>${osgi.import}</Import-Package>
-            <DynamicImport-Package>${osgi.dynamicImport}</DynamicImport-Package>
-            <Bundle-DocURL>${project.url}</Bundle-DocURL>
-          </instructions>
-        </configuration>
-        <executions>
-          <execution>
-            <id>bundle-manifest</id>
-            <phase>process-classes</phase>
-            <goals>
-              <goal>manifest</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
+      <!-- TODO: switch from "jar" to "bundle" packaging as there's no difference in non-OSGi environments -->
       <!-- We need to disable the standard ASF configuration to be able to publish our own notice and license files -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>