Cannot use removeall macro with bnd-maven-plugin 4.0

22 views
Skip to first unread message

konr...@gmx.de

unread,
May 12, 2018, 4:00:28 AM5/12/18
to bndtools-users
According to https://github.com/bndtools/bnd/issues/2131#issuecomment-326634501 it should now be possible to use the following instruction:

# export all versioned packages, except for the ones which are conditionally included, compare with https://github.com/bndtools/bnd/issues/2131

-exportcontents: ${removeall;${packages;VERSIONED};${packages;CONDITIONAL}}


Whenever I use this in my bnd file I get the following error when building with the bnd-maven-plugin 4.0.0


[INFO] --- bnd-maven-plugin:4.0.0:bnd-process (default) @ org.apache.sling.installer.hc ---

[WARNING] /Users/konradwindszus/git/sling-org-apache-sling-installer-hc/bnd.bnd [0:0]: No translation found for macro: removeall;;

[WARNING] /Users/konradwindszus/git/sling-org-apache-sling-installer-hc/bnd.bnd [0:0]: Invalid package name: '${removeall'

[WARNING] /Users/konradwindszus/git/sling-org-apache-sling-installer-hc/bnd.bnd [0:0]: Invalid package name: '}'

[ERROR] /Users/konradwindszus/git/sling-org-apache-sling-installer-hc/bnd.bnd [0:0]: ${removeall}, is not understood. too few arguments, for cmd: removeall, arguments; [removeall]


This leads to a build failure.

What am I doing wrong? Unfortunately, the new macro is only referenced in https://github.com/bndtools/bnd/wiki/Changes-in-4.0.0 but not yet in https://bnd.bndtools.org/chapters/850-macros.html.


Am I using this incorrectly?

Thanks,

Konrad

BJ Hargrave

unread,
May 12, 2018, 6:41:38 AM5/12/18
to bndtool...@googlegroups.com
The issue you have is with the ${packages} macro returning empty strings.

To prove ${removeall} works, try ${removeall;a,b,c;a,c}.

The implementation of removeall in 4.0 does not like empty args. I'll make a fix for 4.1 to support this.

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
BJ

konr...@gmx.de

unread,
May 12, 2018, 11:39:59 AM5/12/18
to bndtools-users
Thanks for the answer. I created https://github.com/bndtools/bnd/issues/2443 to track this enhancement (allowing of empty args for removeall).

BJ Hargrave

unread,
May 15, 2018, 1:13:11 PM5/15/18
to bndtools-users
FYI, this problem can be worked around on Bnd 4.0 by making sure the args to removeall are not empty. For example:

    -exportcontents: ${removeall;not-empty,${packages;VERSIONED};not-empty,${packages;CONDITIONAL}}
Reply all
Reply to author
Forward
0 new messages