I am trying to use maven to build a project that depends on a JNI wrapper around the OpenCV computer vision library. I've been able to "maven-ize" the OpenCV wrapper here: http://ubaa.net/shared/processing/opencv/ by using FreeHEP's NAR maven plugin, but the documentation for that plugin is somewhat lacking.
I've been able to create a project (imagedetect) that depends on the OpenCV jni project (I'm calling that OpenCVJava). imagedetect will compile, however, any test, integration-test, or package target fails with an error about libraries missing from the java.library.path.
!!! required library not found : no OpenCV in java.library.path
Verify that the java.library.path property is correctly set and 'libcxcore.so', 'libcv.so', 'libcvaux.so', 'libml.so', and 'libhighgui.so' are placed (or linked) in one of your system shared libraries folder
This is particularly frustrating -- the only way I know to resolve this is to somehow track down the .nar file for the opencv libraries, manually extract them, set the java.library.path, and then invoke the gnaraly java command to actually execute the tests/application with the proper classpath / library path. This isn't going to work--particularly if this problem persists to transitive dependencies.
How can I make this build/test/execute system cleaner? I'm not set on FreeHEP, but I would like to stick with maven, since it makes our most common use-cases much simpler.
FreeHEP Nar plugin: http://java.freehep.org/freehep-nar-plugin/intro.html