Karaf bundle load precedence

I have a question about karaf and feature loading. I have a kar file which contains all of bundles of my application. It is released on PROD environment. It is a custom build offline Karaf based on version 4.0.4 - and the KAR file is on deploy folder. I would like to make a patch which override one ore more of the same bundles. There is no option to release new version of kar because of some policy. My question is:

  1. The feature files referencing specific versions of bundle. If I put them to /deploy with the same version, the JAR will be used, or is it non deterministic?
  2. When I put newer version (minor version change) of bundle to /deploy, is it used or the specific feature defined version? Or maybe the behaviour is non deterministic?
  3. When there is no deterministic solution for 1 or 2, is there any other?

Upvotes: 1

Views: 369

Answers (1)

Matt Pavlovich
Matt Pavlovich

Reputation: 4316

1a. A referenced bundle in a feature file will be loaded from available repositories (generally, maven repositories). The deploy/ folder is not a repository. Anything in the deploy/ folder is loaded immediately.

1b. If a bundle with matching symbolic name + version is already loaded, Karaf will not load a second version if a feature file specifies it. Think of the feature definition of what features and bundles to load as "load this if its not already present"

  1. If it is a second file, it will be deployed as a second bundle. The unique "key" so to speak of a bundle is the symbolic name + version based on the values in the MANIFEST.MF.

  2. n/a. It is deterministic.

Upvotes: 2

Related Questions