More information about -exportcontent

Can someone tell me what-exportcontent does, and how it differs from Export-Package? The documentation is a bit lean for -exportcontent.

Is it true to say that -exportcontent is mostly useful when working with a -nobundles: true package/bundle? That the idea is to make the selected packages available for downstream project that might be dependent on it using version=project? Or is there a use case for -exportcontent when generating a bundle too?

Export-Package = -includepackage + -exportcontent. That is, Export-Package will add packages to the bundle, perhaps from jars on the classpath, and also add those packages to the Export-Package manifest header. -exportcontent will only add packages which are already part of the bundle to the Export-Package manifest header.

So -exportcontent is appropriate for Maven and Gradle (non-Bnd workspace) builds where the content of the bundle is being managed by normal Maven or Gradle means.

Thanks BJ, that is what i guessed - thank you for confirming.

However, this raises another question: what purpose (if any) does -exportcontent serve if your bnd file is set for -nobundles: true? In this case, no manifest is generated, right? There are a couple of examples of this in the Bnd build itself (which, of course, is a Bnd workspace build and not Maven or Gradle-non-WS).

None. (My post must be at least 20 characters long to allow me to post it.)