Bndtools, including an file into OSGi bundle

17 views
Skip to first unread message

Bleza TAKOUDA

unread,
Oct 6, 2015, 12:18:31 AM10/6/15
to bndtools-users
Hello !
I am confused about including other resources (xml file or a picture) into a bundle using the OSGi Bnd perspective.
I tried to put the XML file in the same package with my classes but it seems not work.
I'd appreciate any hint about this.

Greg Amerson

unread,
Oct 6, 2015, 2:17:46 AM10/6/15
to bndtool...@googlegroups.com
Put it in a folder called "resources" at the root of your bundle and then in the .bnd file add a "-include: resources/SomeXMLFile.xml" and then bndlib when it makes your bundle will copy the file from the resources folder and put it in the root of your generated bundle.

--
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.



--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

Timothy Ward

unread,
Oct 6, 2015, 3:35:17 AM10/6/15
to bndtool...@googlegroups.com
Hi,

The documentation describes how you can include resources into a bundle. The bnd header that you’re looking for is called Include-Resource


A simple stanza would be:

Include-Resource:  resources/SomeXMLFile.xml

The instruction equivalent of this header is -includeresource, not -include as previously indicated on the list. -include is used to include properties from a parent bnd file.

Regards,

Tim

Bleza TAKOUDA

unread,
Oct 6, 2015, 3:49:22 AM10/6/15
to bndtools-users
It really worked. Thank you for sharing.

Best regards,
-Bleza-
Reply all
Reply to author
Forward
0 new messages