2008/9/6 Richard Wallace <[EMAIL PROTECTED]>

>
> P.S.  I've also been struggling with what scope to give things.  Does what
> I have look reasonably correct?
>

Here's what I personally use for scopes, but note there isn't a perfect
mapping:

   compile  -  non-OSGi dependencies I need during compilation
                    (btw, no-scope == compile)

   runtime  -  non-OSGi dependencies I don't need during compilation,
                    but do need at runtime (I don't use this much - often
just
                    when embedding runtime artifacts inside bundles)

   provided  -  OSGi bundle dependencies

of course the downside of using provided for bundle dependencies is that you
don't get their dependencies pulled in, because provided dependencies aren't
transitive.

But OSGi supports replaceable components/dependencies - so I don't see this
as a major downside, because it lets me choose which bundles I actually want
to deploy (which might be different to the ones used to compile with).

That's where the pax-construct tools (like pax-import-bundle) come in - with
the
pax-import-bundle command I can add a bundle dependency, and optionally pull
in all its bundle dependencies (which I can then tweak as necessary).

FYI, I also tend to mark compile and runtime scoped dependencies as
<optional>
which means they won't get pulled in when another project depends on my
bundle
(because typically the bundle is a replacement for the non-OSGi
compile/runtime
dependency - ie. the non-OSGi dependencies never leak through)

-- 
Cheers, Stuart
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to