How does MVNRepository know that a jar is an OSGI bundle or not?

95 Views Asked by At

How does MVNRepository show that a particular JAR file is a bundle or not? For example https://mvnrepository.com/artifact/commons-io/commons-io/2.6 shows the download links as jar while if a jar is built as a bundle it shows the display as bundle (as in https://mvnrepository.com/artifact/com.google.guava/guava/26.0-jre) ?

enter image description here

For us to know if a jar file is a bundle or not is to download it, open it then inspect the contents. But can MVNRepository does that on the fly or will it do it before indexing some package and mark them as Jar or Bundle?

1

There are 1 best solutions below

0
On

I believe this is inferred from the POM:

  <packaging>bundle</packaging>

But when deploying the artifact, OSGi only cares about the contents of the manifest file. Even a WAR artifact can be a valid bundle.