-1

I have two bundles:

  1. bundleName.2.0.0.324999.jar
  2. bundleName.2.0.0-SNAPSHOT.jar

When I am trying to install them in Apache Felix console, the one which I am trying to install gets the priority.

So my question is, how does it decides the priority then?

Skeptic Scribbler
  • 527
  • 1
  • 6
  • 18

1 Answers1

0

You can install both of these bundles at the same time if you like. OSGi does not have a concept of "priority" between bundles.

Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
  • Thanks a lot for the response @Neil . The reason why I asked this because OSGi Installer document(https://sling.apache.org/documentation/bundles/osgi-installer.html , the bundle handling section) clearly says "In general, the OSGi installer always tries to install the highest version of a bundle if several bundles with the same symbolic name are provided. In this case higher version wins over priority." So thats the priority I am talking about! – Skeptic Scribbler Feb 19 '17 at 09:53
  • 1
    @SkepticScribbler I see. That document is talking about a piece of software that they have written, called an "OSGi Installer", i.e. something that installs bundles into OSGi. So this is a question about Sling, not core OSGi. I think that what they mean is that if their installer finds two bundles with the same Bundle-SymbolicName, it will only install the one with the higher version. – Neil Bartlett Feb 19 '17 at 12:56
  • @SkepticScribbler Another point is that it's impossible to tell the versions of these bundles from any information you have given. You have only shown filenames, which can be anything and have no connection to the bundle identity or version. – Neil Bartlett Feb 19 '17 at 12:58
  • I am delighted to get the response! Thanks for pointing out for not being clear. Let me explain how I have made them. So I have build my code in two ways: 1. by jenkins which gave me this jar- bundleName.2.0.0.324999.jar 2. Then I made few changes in my code and build it by local maven build which gave me this jar- bundleName.2.0.0-SNAPSHOT.jar – Skeptic Scribbler Feb 19 '17 at 13:45
  • Technically, SNAPSHOT.jar should take more priority and after installing it, If I am trying to install the 324999.jar, it should reject it because snapshot jar is more updated. Abt bundle version, its the same version which gets appended to its name and which is also same in pom.properties file. – Skeptic Scribbler Feb 19 '17 at 13:52
  • "It should reject it". Well, OSGi won't reject it for you. As I said, it's legal to install both of these bundles at the same time. Also, 2.0.0-SNAPSHOT is not a legal OSGi version. – Neil Bartlett Feb 19 '17 at 14:36
  • Okay thanks! I will try with the "legal" versions then! – Skeptic Scribbler Feb 19 '17 at 14:44