sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seifert <>
Subject RE: issues switching to bnd maven plugin
Date Thu, 14 Nov 2019 15:50:33 GMT
i was able to find a solution for this problem, although the syntax is a bit fragile and non-intuitive:

the reason it was ignored completely in my first attempts was that i defined a <configuration>
section directly on the plugin element, whereas in the parent pom it was defined on an execution
element, which always had higher precedence. moving it down to the same position in the local
POM lead to respecting both and merging the configurations.

and putting comments in between the lines of the import statements worked as well with a)
removing the CDATA around it and b) making sure the comment lines also end with "\" (outside
the comment). not nice, but works.


>-----Original Message-----
>From: Julian Sedding []
>Sent: Friday, November 1, 2019 12:34 PM
>To: Sling Developers List
>Subject: Re: issues switching to bnd maven plugin
>Hi Stefan
>I agree with your goals, but I think that *should* be possible with
>the bnd-maven-plugin. Recently I looked into the source of the plugin
>and the documentation suggests that you need to use either bnd
>instructions in the pom or a bnd-file (in my understanding that is per
>maven module). The instructions from a parent pom are then merged
>using custom logic, see [0]. Maybe reading the implementation of
>"loadProperties"[1] helps get you unstuck?
>On Fri, Nov 1, 2019 at 11:49 AM Stefan Seifert <>
>> additionally to the problems with the bnd baseline maven plugin I'm a bit
>happy with the way to express project-level bnd instructions with the bnd-
>maven-plugin, encountered on the branch [1].
>> 1. basically the bnd maven plugin supports both bnd.bnd file and
>configuration via bnd config parameter in the POM (although the latter is
>not recommended).
>> - i know the bnd people have their own special view on POM files and XML
>file format and try to put everything outside the POM
>> - i personally prefer to have those instructions all in the POM, e.g.
>they are then easily detectable also for uploaded libraries with their POM
>on maven central (and not only in the source jar)
>> - in general it does not seem to be possible to define a "chain" of parts
>of bnd configurations in multiple parent poms, each contributing some
>> - unlike the maven-bundle-plugin there is only a single "bnd"
>configuration parameter (we are using it in sling-bundle-parent), and it
>does not seem to possible to define additional instructions in the local
>> - or i did something wrong when trying it
>> - especially if there are multiple parent POMs involved this seems to be
>a big restriction for me
>> 2. sometimes a module has some complex instructions which need line-by-
>line comments to know the reason why they are there
>> - see [2] for example in caconfig-impl
>> - this is no longer possible in a bnd file because it breaks the multi
>line syntax with \ in the line endings
>> - so i ended up collecting the comments above the instructions [3], but
>this is not a good replacement
>> - is there a better solution?
>> 3. i would like to have back an XML-structured way of defining bnd
>instructions as it was the case in maven-bundle-plugin in bnd-maven-plugin!
>> - this was easy to document
>> - and it nicely followed the maven-ways of inheriting and overwriting
>individual parameters
>> stefan
>> [1]
>> [2]
>> [3]

View raw message