You are fully right.

In fact you can even distinguish runtime and compile time libraries in maven. In reality though often all libraries are simply marked as compile (which is compile + runtime). Additionally people regularly forget to clean up the dependencies and remove unused ones. So as you stated maven often has more dependencies than are needed.

This is also why I rather do not trust the karaf maven plugin to create features from the maven deps and instead create them by hand. As this is also error prone we really need something better here. OBR and similar solutions could help there but I have not yet seen a working solution in practice till now.

Christian

On 25.10.2014 00:53, Neil Bartlett wrote:
No, I’m not.

Bnd performs a full inspection of the dependencies of the classes included in 
the bundle, and generated imports for the referenced packages (or, in the case 
of Conditional-Package, adds those packages to the bundle). Whereas the 
libraries specified in the POM are just the ones that some human thought might 
be necessary. Or perhaps they were necessary to satisfy the javac compiler but 
they were not necessary or even sufficient to actually run the code.

Humans are lazy, bnd is smart and thorough. I trust bnd to do what it does more 
than any human, including myself.

Java developers REALLY need to break this habit of thinking that compile time 
and runtime dependencies are the same! They are not. You compile against APIs 
and run with implementations.


Neil



--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to