Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Conditional dependencies in manifest?
Conditional dependencies in manifest? [message #119814] Mon, 20 October 2008 17:46 Go to next message
Chris W is currently offline Chris WFriend
Messages: 33
Registered: July 2009
Member
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 #119827 is a reply to message #119814] Mon, 20 October 2008 17:57 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
I'd manage the dependency using Import-Package instead of Require-Bundle,
that way you don't care which bundle is installed and giving you the various
log4j packages. If that's what you're doing already can you give a bit more
detail.

-Simon
"Chris W" <chris@firestruck.com> wrote in message
news:f18abc5b6a411dc1c013d31af03f200e$1@www.eclipse.org...
> 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 #119853 is a reply to message #119827] Tue, 21 October 2008 00:28 Go to previous messageGo to next message
Chris W is currently offline Chris WFriend
Messages: 33
Registered: July 2009
Member
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
Re: Conditional dependencies in manifest? [message #119879 is a reply to message #119853] Tue, 21 October 2008 16:48 Go to previous message
Eclipse UserFriend
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
Previous Topic:Thanks: how should I use API's manipulate bundles as in the console?
Next Topic:headless eclipse - classpath issues
Goto Forum:
  


Current Time: Tue May 07 19:11:28 GMT 2024

Powered by FUDForum. Page generated in 0.03704 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top