I agree about the messy part with blacklisting.  It's a good way to keep
from being blocked from an issue you otherwise can't around, is how I look
at it.

I guess I hope that eventually there will be an awareness by developers
around putting a little more thought into code organization and
dependencies.  I think tools and convenience have caused a lack of
awareness which has only caused nonmodular libraries and unnecessary
dependencies.  Karaf features definitely helps to alleviate that for sure.

Ryan

Ryan

On Sun, Sep 1, 2019, 3:11 AM Steinar Bang <[email protected]> wrote:

> >>>>> Ryan Moquin <[email protected]>:
>
> > Hi Steinar,
> > There are a couple ways.
>
> > 1. You can use <scope>runtime</scope> to prevent a jar from being added,
> > but that has other ramifications when building (such as I think unit test
> > code won't see the dependency)
> > 2. You can use <scope>provided</scope> to only include that dependency
> but
> > not of it's transitive dependencies in the feature.xml
>
> Yup, but I didn't want to touch their dependencies if I could avoid it.
>
> > 3. The karaf maven plugin has an option to excludeArtifactId (look in the
> > docs of the karaf site)
>
> Right.  Something like this is what I looking for, but unable to find
> (it was late at night and my googling skills may not have been at the
> top of their game...:-) )
>
> > 4. If you really have to, you can blacklist a bundle using the karaf
> maven
> > plugin, but that would be a last resort IMHO.
>
> Hm... this sounds like the kind of thing that made OSGi messy before I
> discovered karaf and features in 2016.  So I agree.
>
> > I would use one of the first 2 options primarily.  Also, you can use the
> > maven exclude to prevent certain transitives from being added to the
> > feature xml.
>
> I run with
>    <includeTransitiveDependency>false</includeTransitiveDependency>
> by default.
>
> Thanks for your help so far! :-)
>
>

Reply via email to