javamavenmaven-2maven-pluginmaven-bundle-plugin

What mean packaging:bundle mean inside the POM?


When I download the protobuf-javalite-3.17.3 pom: https://repo1.maven.org/maven2/com/google/protobuf/protobuf-javalite/3.17.3/protobuf-javalite-3.17.3.pom I can see inside

<packaging>bundle</packaging>

What packaging : bundle mean exactly? on https://repo1.maven.org/maven2/com/google/protobuf/protobuf-javalite/3.17.3/ I can see that their is a protobuf-javalite-3.17.3.jar but no protobuf-javalite-3.17.3.bundle, so do I need to download instead the protobuf-javalite-3.17.3.jar ?


Solution

  • Though the question has basically been answered in the comments by @khmarbaise, some references and elaboration might be useful.

    According to the chapter in Maven's POM Reference on Packaging, the <packaging> tag in a .pom file defines, how a project file has to be packaged. Thereby:

    The current core packaging values are: pom, jar, maven-plugin, ejb, war, ear, rar.

    The default is jar. Other packaging types can be provided through plugins.

    Now, <packaging>bundle</packaging> refers to an OSGi bundle.

    Technically, a [OSGi] bundle is just a jar file with a MANIFEST.MF file containing some OSGi-specific headers.

    For an overview you might be interested in an Introduction to OSGi.

    So, yes. You will want to download the protobuf-javalite-3.17.3.jar. When unzipping it and taking a look into the MANIFEST.MF file you will discover the OSGi-related entry

    Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"