I wish to add a JNI library, including its shared object (.so) file to my project using Maven. Unfortunately it is not yet on a public repository so I guess I have to install it
My approach:
Put .so
files to repository with platform specific classifier, like this: sqlite3-3.7.9-linux-x86_64.so
.
Add .so
dependencies for all required platforms:
de.ch-werner
sqlite-jdbc
3.7.9
so
linux-x86_64
Use this maven assembly plugin config to put all native libs into lib/native
directory of you dist:
lib/native
${artifact.artifactId}${dashClassifier?}.${artifact.extension}
false
false
false
*:*:dll:*
*:*:so:*
*:*:jnilib:*
Use this class to load libs on app startup (planning to change classifier naming to GNU triplets):
CtzJniUtils.loadJniLibsFromStandardPath(Launcher.class, "sqlite3")