Closed kwin closed 3 years ago
I don't think pom-based bndrun configuration is a good idea. Unlike building a bundle with bnd-maven-plugin, bndrun configuration is used across many Bnd maven plugins. Resolve uses it, test uses it, run uses it. Since I am unaware of any way in a pom to defined configuration which can be used by several plugins, the separate bndrun file is important. It is also important since the Bndtools UI can edit and resolve bndrun files.
My use case for inheritance is: Checking several bundles if they resolve against a common baseline of bundles. For the common baseline of bundles I currently use
-include ../baseline.bndrun
with baseline.bndrun
having
-standalone: ${fileuri;${.}/target/index.xml}
-runfw: org.apache.felix.framework
-runee: JavaSE-1.8
I would love to encapsulate the baseline in a dedicated Maven artifact (containing both the repositoy index.xml, generated with bnd-indexer-maven-plugin, as well as the relevant bndrun configuration referencing it). Any other idea how to reference such a common base line from Maven coordinates?
Also if bnd-resolver-maven-plugin
, bnd-run-maven-plugin
and bnd-testing-maven-plugin
share a common configuration, it would probably make sense to encapsulate all of them in different mojos in the same(!) plugin. That way they could easily share a configuration
Also if
bnd-resolver-maven-plugin
,bnd-run-maven-plugin
andbnd-testing-maven-plugin
share a common configuration
They don't share a common maven configuration but can share a common bndrun file.
Using external configuration files for parameterizing runs of Maven plugins is kind of an anti-pattern (due to the limited inheritance)
kind of an anti-pattern
Perhaps, but since Bnd supports much more than just maven and Bnd already has bndrun files, the current approach is used.
My use case for inheritance is
Perhaps @rotty3000 can suggest a better maven configuration story for your use case.
isn't this group of data which you want to resolve against:
-standalone: ${fileuri;${.}/target/index.xml}
-runfw: org.apache.felix.framework
-runee: JavaSE-1.8
represented by a distro?
Futhermore, a distro file is an artifact (jar) which you can publish into a maven repo.
creating a distro is simple:
bnd remote distro <bsn> <[version]>
here's an example I did with Karaf a while back https://github.com/rotty3000/demo-live-coding
@rotty3000 Thanks a lot for that hint. Is there any Maven tooling support for automatically creating distro's? I do have a list of Maven (bundle) dependencies and some additional hardcoded config. Out of this I would like to continuously create distros (preferably with Maven).
Closing.
Currently the Maven plugin only uses external bndrun files (https://github.com/bndtools/bnd/blob/fb81a01eed1a89760d8e32f27b795ecf727cb03f/maven/bnd-resolver-maven-plugin/src/main/java/aQute/bnd/maven/resolver/plugin/ResolverMojo.java#L104). Similar to
bnd-maven-plugin
s parameterbnd
(https://github.com/bndtools/bnd/tree/master/maven/bnd-maven-plugin#configuration-parameters) it should support in-pom launch description (which can potentially be inherited).