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
3. The karaf maven plugin has an option to excludeArtifactId (look in the
docs of the karaf site)
4. If you really have to, you can blacklist a bundle using the karaf maven
plugin, but that would be a last resort IMHO.

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.

Hope that helps,
Ryan

On Fri, Aug 30, 2019 at 6:51 PM Steinar Bang <s...@dod.no> wrote:

> Is it possible to make karaf-maven-plugin exclude some dependencies with
> <scope>compile</scope>?
>
> I'm trying to create a pull request to fix this issue
>  https://github.com/pgjdbc/pgjdbc/issues/1552
> and the PostgreSQL JDBC driver pulls in and includes two dependencies,
> that I would like to not pull in with the feature.
>
> Firstly, the aren't needed (since they are embedded into the psql jar).
> Secondly, they aren't OSGi bundles, so karaf wraps them:
> 51 │ Active │  80 │ 0               │
> wrap_file__home_sb_.m2_repository_com_github_waffle_waffle-jna_1.9.1_waffle-jna-1.9.1.jar
> 52 │ Active │  80 │ 0               │
> wrap_file__home_sb_.m2_repository_com_ongres_scram_client_2.0_client-2.0.jar
>
> Thanks!
>
>

Reply via email to