Hi Curt,

There is also an encapsulation of log4j in felix trunk/commons/log4j . If I 
understand well, the proposal is that the log4j artifact in apache log4j 
project is also a bundle ? great ! (even better if this bundle is made 
available on an "OBR" reopsitory).

Concerning optional packages, maybe you can :
remove almost everything from "Import-Package"
and add a "DynamicImport-Package" clause so that if specific appenders are 
required by configuration, and a bundle provides the packages needed by these 
appenders, they can be used, but if you need only FileAppender and 
ConsoleAppender you can use a very minimal configuration?

I have personnaly recently built a log4j 1.2.13 bundle, starting from the felix 
log4j project which was providing 1.2.12, and I suppressed the importation of 
javax.* packages in order to limit the number of dependencies. Seems to work 
anyway.

Anne
-----Message d'origine-----
De : Curt Arnold [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 14 août 2008 01:03
À : [email protected]
Objet : log4j bundling: request for comments

We are preparing a log4j 1.2.16 release over at Logging Services and adding 
OSBi bundle metadata was on our bug list 
(https://issues.apache.org/bugzilla/show_bug.cgi?id=432820
).  I've taken a shot at modifying our pom.xml to use maven-felix- plugin and 
would appreciate any comments.

Here is the situation:

log4j-1.2.16.jar contains classes in org.apache.log4j and child packages.  
org.apache.log4j.lf5 and org.apache.log4j.chainsaw packages are provided in the 
jar for compatibility with earlier jars, however neither are intended for use 
(LF5 is dead and Chainsaw 2 is its own deliverable now).  Those classes are 
suppressed from exporting.

log4j sniffs for IBM Visual Age in some diagnostic code which resulted in 
"com.ibm.uvm.tools" in the default imports.  Also, Agent.java which has no 
known users loads com.sun.jdmk.comm.HtmlAdapterServer by reflection.  Imports 
of both those packages are suppressed.

Between the JMX, JMS, SMTP and other appenders, log4j does import many
java.* and javax.* packages.  Those packages aren't essential to the 
functioning of log4j, just specific appenders.

The changes to the pom.xml were:

=
=
=
=
=
=
========================================================================
--- logging/log4j/trunk/pom.xml (original)
+++ logging/log4j/trunk/pom.xml Wed Aug 13 12:27:27 2008
@@ -19,7 +19,7 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>log4j</groupId>
   <artifactId>log4j</artifactId>
-  <packaging>jar</packaging>
+  <packaging>bundle</packaging>
   <name>Apache Log4j</name>
   <version>1.2.16-SNAPSHOT</version>
   <description>Apache Log4j 1.2</description> @@ -367,6 +367,20 @@
         <artifactId>rat-maven-plugin</artifactId>
         <version>1.0-alpha-3</version>
       </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>1.4.3</version>
+        <extensions>true</extensions>
+        <configuration>
+            <instructions>
+                <!-- omit chainsaw and LF5   -->
+                <Export-Package>!org.apache.log4j.lf5.*,! 
org.apache.log4j.chainsaw.*,org.apache.log4j.*</Export-Package>
+                <!--  IBM Visual Age and HTMLAdapterServer are
sniffed by reflection -->
+                <Import-Package>!com.ibm.uvm.tools,! 
com.sun.jdmk.comm,*</Import-Package>
+            </instructions>
+        </configuration>
+      </plugin>
     </plugins>
     <testSourceDirectory>tests/src/java</testSourceDirectory>
     <testResources>

The generated MANIFEST.MF was:


Manifest-Version: 1.0
Built-By: curta
Created-By: Apache Maven Bundle Plugin
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Import-Package: javax.jms,javax.mail,javax.mail.internet,javax.managem
  ent,javax.naming,javax.xml.parsers,org.apache.log4j,org.apache.log4j.
  config,org.apache.log4j.helpers,org.apache.log4j.jdbc,org.apache.log4
  j.jmx,org.apache.log4j.net,org.apache.log4j.nt,org.apache.log4j.or,or
  g.apache.log4j.or.jms,org.apache.log4j.or.sax,org.apache.log4j.spi,or
  g.apache.log4j.varia,org.apache.log4j.xml,org.w3c.dom,org.xml.sax
Bnd-LastModified: 1218653302446
Export-Package: org.apache.log4j.or.sax;uses:="org.apache.log4j.or,org
  .xml.sax",org.apache.log4j.or;uses:="org.apache.log4j,org.apache.log4
  j.spi,org.apache.log4j.helpers",org.apache.log4j.spi;uses:="org.apach
  e.log4j.or,org.apache.log4j,org.apache.log4j.helpers",org.apache.log4
  j.jmx;uses:="org.apache.log4j,org.apache.log4j.spi,javax.management,o
  rg.apache.log4j.helpers",org.apache.log4j.xml;uses:="org.apache.log4j
  .or,org.apache.log4j.spi,org.xml.sax,org.w3c.dom,org.apache.log4j.con
  fig,org.apache.log4j,javax.xml.parsers,org.apache.log4j.helpers",org.
  apache.log4j.net;uses:="org.apache.log4j.spi,org.apache.log4j.xml,org
  .w3c.dom,org.apache.log4j,javax.naming,javax.mail.internet,javax.mail
  ,javax.jms,org.apache.log4j.helpers",org.apache.log4j.config;uses:="o
  rg.apache.log4j,org.apache.log4j.spi,org.apache.log4j.helpers",org.ap
  ache.log4j.jdbc;uses:="org.apache.log4j,org.apache.log4j.spi",org.apa
  che.log4j;uses:="org.apache.log4j.or,org.apache.log4j.spi,org.apache.
  log4j.config,org.apache.log4j.helpers",org.apache.log4j.or.jms;uses:=
  "org.apache.log4j.or,javax.jms,org.apache.log4j.helpers",org.apache.l
  og4j.varia;uses:="org.apache.log4j,org.apache.log4j.spi,org.apache.lo
  g4j.helpers",org.apache.log4j.nt;uses:="org.apache.log4j,org.apache.l
  og4j.spi,org.apache.log4j.helpers",org.apache.log4j.helpers;uses:="or
  g.apache.log4j,org.apache.log4j.spi"
Bundle-Version: 1.2.16.SNAPSHOT
Ignore-Package: org.apache.log4j.lf5.config,com.ibm.uvm.tools,org.apac
  he.log4j.lf5.viewer.images,com.sun.jdmk.comm
Bundle-Name: Apache Log4j
Bundle-Description: Apache Log4j 1.2
Build-Jdk: 1.5.0_13
Private-Package: org.apache.log4j.lf5.config,org.apache.log4j.lf5.view
  er.images
Bundle-DocURL: http://www.apache.org
Bundle-ManifestVersion: 2
Bundle-Vendor: Apache Software Foundation
Bundle-SymbolicName: log4j.log4j
Tool: Bnd-0.0.255

Name: org.apache.log4j
Implementation-Title: log4j
Implementation-Version: 1.2.16-SNAPSHOT
Implementation-Vendor: "Apache Software Foundation"


A release candidate for log4j 1.2.16 will be prepared in the next few days.  
Any comments before release preparation or during the voting would be 
appreciated either here, on the bug or on [EMAIL PROTECTED] .

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to