I try to work if there is a specific, recommended, reliable way to work with native libraries in Java and Maven.
I know that this can be done by placing libraries in the right places, setting java.library.pathand calling System.loadLibrary, etc. - but I want the right solution to work throughout the entire development / deployment life cycle, t involves a lot of hacks.
My requirements seem pretty simple:
- 100% configuration via Maven
- The ability to include your own dependencies for different platforms / architectures (mainly Linux and Windows, others will be nice, though ...)
- The ability to create a runnable
.jar, which does not require the user to bother with the command line parameters to run it (that is, he unpacked and downloaded any of his own dependencies that he needed at runtime, preferably as temporary files or something like that) - The code works during development (in Eclipse)
- The code works during normal Maven build on the command line
Basically, I want the natives to work both at development time and for the user at run time.
Is it possible? If so, what do I need to configure for this to happen?
source
share