Failed to include native libs in jar

42 views
Skip to first unread message

Arne Plöse

unread,
Dec 12, 2016, 3:28:18 AM12/12/16
to bndtools-users
Hi,

I have some native libs under src/lib/.
They get copied to bin/ - but never show off in generated/*.jar.
The Bundle-NativeCode directive fails.

Should I use -includeresource in bnd.bnd to include them - but ist already in bin?

A second issue:

putting the libs to resources/lib and adding this to thze buildpath src directories - the gradle build will it ignore completely ...

Arne 

BJ Hargrave

unread,
Dec 12, 2016, 8:54:54 AM12/12/16
to bndtool...@googlegroups.com
Perhaps you could make a github repo to demonstrate the issues? There is not enough detail in this email to try and understand your problems sufficiently to make informed comment.

-includeresource is probably best for adding resources to your bundle vs. having them in a src folder.

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

Arne Plöse

unread,
Dec 12, 2016, 3:55:30 PM12/12/16
to bndtools-users
Here we are:

https://github.com/aploese/spsw

the main buld is currently maven, eclipse fails in provider native lib, gradle cant detect the test path at src/test/java...


Arne

BJ Hargrave

unread,
Dec 12, 2016, 4:35:01 PM12/12/16
to bndtool...@googlegroups.com
You have a rather awkward set up where a maven driven build and a Bnd Workspace model build set in the same folders. You should pick either a maven drive build and use the bnd Maven plugins or you should pick a Bnd Workspace model where bnd drives the build (using gradle for command line building).

Maven builds are laid out differently than Bnd Workspace builds. For example, maven puts java source in src/main/java and resources in src/main/resources. Bnd Workspace builds put src and resources together in src.

Since you would seem to prefer maven-driven builds, you should use m2e with Eclipse and the bnd maven plugins (bnd-maven-plugin is the main plugin) to make your bundle jars in maven. Then you can remove all the gradle things which are for Bnd Workspace model builds.


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

Arne Plöse

unread,
Dec 13, 2016, 2:48:28 AM12/13/16
to bndtools-users
Yes,

currently Im building with maven, but you can open this bndworkspace in eclipse and build it with eclipse.

Eclipse will copy resources/* to bin. Bnd should pick up the native libs from there?!

Arne

BJ Hargrave

unread,
Dec 13, 2016, 8:45:09 AM12/13/16
to bndtool...@googlegroups.com
It probably will. But, as I stated, you have a completely abnormal setup. If it works for you that's great, but if it doesn't then it doesn't.

If you want to use a maven build, you should use m2e in eclipse and use the bnd-maven-plugin to make your bundles.

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

Arne Plöse

unread,
Dec 15, 2016, 11:06:37 AM12/15/16
to bndtools-users
Hi,

it looks, that bnd ignores the .classpaht settings.

From this issue report: "Maven project layout folders not added to bnd.bnd" https://github.com/bndtools/bndtools/issues/1277
From this, I guess you force all users to use the "eclipse layout" only. No exceptions!
No wonder it doesn't find the native libs...

Arne

BJ Hargrave

unread,
Dec 15, 2016, 11:18:15 AM12/15/16
to bndtool...@googlegroups.com
Bnd does not use Eclipse metadata files. Bndtools has some validators to warn about consistency issues between .classpath and bnd.bnd files view of the paths.

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

Arne Plöse

unread,
Dec 15, 2016, 2:57:59 PM12/15/16
to bndtools-users
Ok, solved.

I changed the src layout to what bnd is used to ;-).
Adding the following to the Manifest
Private-Package: \
        de.ibapl.spsw.spi,\
        de.ibapl.spsw.provider,\
        lib

this includes the "new" packages of the provider.jar - lib/* included...

Arne
Reply all
Reply to author
Forward
0 new messages