Conditional dependencies in manifest? [message #119814] |
Mon, 20 October 2008 13:46  |
Eclipse User |
|
|
|
We need to handle our log4j dependency for 3.2.2 and 3.3+. The Eclipse
SDKs are different for lo4gj - 3.2 comes with (or via WST) bundle
"org.apache.jakarta_log4j" whereas 3.3+ with "org.apache.log4j". To avoid
additional install steps for our product, our thinking was employing some
sort of conditional dependency in our bundle manifest: if not
"org.apache.log4j", then "org.apache.jakarta_log4j".
I don't see conditional dependencies for OSGi, although ideas have been
propose. I don't see how "optional" would work given that we have a hard
dependency on Log4j.
Is this possible? Another option?
Thanks.
|
|
|
|
|
Re: Conditional dependencies in manifest? [message #119879 is a reply to message #119853] |
Tue, 21 October 2008 12:48  |
Eclipse User |
|
|
|
Originally posted by: ekkehard.gentz-software.de
Chris W schrieb:
> Thanks Simon.
>
> I believe that would work, but, what I left out, is that we have our own
> appender and also log to Eclipse's log, see we require a buddy
> connection. Could I import "org.apache.log4j" and have two separate
> buddy entries - one for "org.apache.log4j" and the other for
> "org.apache.jakarta_log4j"?
>
> Eclipse-RegisterBuddy: org.apache.log4j
>
as Simon says,
you should use package-import
and your appender should work without buddy,
try a Fragment Bundle - I'm using a Fragment Bundle per ex. to make
extensions of LogBack classes which should be similar to Log4J
you should use Buddys only if there's no other standard
osgi way to solve the requirement
BTW: I'll report exactly about these Fragment bundles in my next blog
about "Logging in OSGI Enterprise apps" (http://ekkes-corner.org)
ekke
|
|
|
Powered by
FUDForum. Page generated in 0.13561 seconds