On Thu, Sep 5, 2013 at 12:34 PM, Jaroslav Tulach <[email protected]> wrote: >> [...] > As splitted packages are rare (and maybe even unsupported in some versions of > OSGI), then a package import basically means non-transitive dependency. > > You may realize that your belief is a specialization of my general > observation. As such it is of no surprise, that if non-transitive JAR > (compilation) dependencies work sufficiently, import package works for you in > OSGi. > > Import-Package seems to be a solution of the transtivity issues, but a bit too > narrow and certainly not the only one. > -jt
Stepping back a bit, I feel that the underlying failure in Maven is to distinguish between build and runtime dependencies. They require different approaches. I think we are in broad agreement about how to manage build dependencies. They are not required to be transitive -- to compile each module we only need visibility of the modules it directly imports. They should not use ranges because this results in non-repeatable builds; for my customers it is important to be able to reproduce a build precisely, even many years into the future. In the bnd build system we can go beyond fixed module identity+version and actually depend on the SHA hash of a module. Admittedly we also made the mistake of using dependency ranges at build time but now strongly discourage it. Runtime dependencies are unavoidably transitive. The key is therefore to find ways to minimise the transitive dependency graph, which is the purpose of the OSGi Import-Package instruction, since it creates opportunities to refactor module contents and/or find alternative providers. Neil > > >
