Hey all devs,
I been playing lately with development of side extension and found an unexpected thing - openhab bill of material poms do not provide a
dependencyManagement section. This means that by importing any openhab BOM you always get all dependencies declared there, even if you need only.
The main reason why I bring it here is because standard use (at least which I have seen in other projects) of BOMs is to manage dependencies and their versions and not only “import” dependencies. People who use then such a BOM can refer dependencies without explicit versions as they are inherited from base project.
<dependencies> <dependency> <groupId>org.osgi</groupId> <artifactId>osgi.core</artifactId> <version>6.0.0</version> </dependency> ... ... ... </dependencies>
This means that such dependency is propagated to every project which imports
org.openhab.core.bom.compile. There are much more dependencies in same pom which gets into every binding/transport/io module.
In other project BOMs dependencies such this are listed in different way:
<dependencyManagement> <dependencies> <dependency> <groupId>org.osgi</groupId> <artifactId>osgi.core</artifactId> <version>6.0.0</version> </dependency> ... ... ... </dependencies> </dependencyManagement>
This means that project after importing a BOM still needs to declare explicit dependency on
org.osgi:org.osgi and other things as needed.
I am aware that current use of BOMs drastically simplifies binding development as their developers don’t have to worry about all modules, however shouldn’t we make it a bit smarter and at least let proper use of Maven dependencies? Could we (as OH project) provide a different variant of BOM, one which promotes fine grained control over classpath?