Hi David,
“compile-only” is a requirement namespace, and the choice of namespaces is completely arbitrary*. In this case the requirement deliberately prevents the bundle from resolving at runtime, because there is presumably no other bundle that provides a runtime capability of “compile-only”.
The point of this is to define a bundle that should be used for compilation but not at runtime. In En Route the philosophy is that API packages should be included in provider bundles, therefore it is unnecessary and confusing to have runtime bundles that only export APIs without providing (i.e. implementing) them. I should say that this philosophy is not universally accepted in OSGi circles, but nevertheless En Route is “opinionated software” so that is what it does.
However it’s still useful to have a compile-time JAR that contains only API, because consumers can build against this without any danger of accidentally depending on implementation details that are specific to one provider. It’s also use for those compile-time JARs to be real bundles with versioned Export-Packages, so that bnd can generate correct ranges on your Import-Packages.
So, we create these API bundles and then flag them as “Require-Capability: compile-only” to prevent them being used at runtime. Unfortunately different people are doing this with different namespaces… I have seen “no.resolve” and “do.not.resolve” for example. It would be nice if we could agree a single consistent name, maybe En Route will help with that.
Regards,
Neil
* though only the OSGi Spec is allowed to define namespaces that begin with “osgi.”.