I have two maven modules:
- native-wrapper - is a JNI wrapper over system lib, that is build by nar-maven-plugin.
- main-module - depends on native-wrapper and uses it's JNI calls during tests.
Tests in native-wrapper work fine. But, during tests in main-module, I get "UnsatisfiedLinkError" - NarSystem is unable to locate my JNI lib.
native-wrapper's pom includes:
...
<packaging>nar</packaging>
...
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.0.0-rc-2</version>
<extensions>true</extensions>
<configuration>
<libraries>
<library>
<type>jni</type>
<narSystemPackage>some.native.wrapper</narSystemPackage>
</library>
</libraries>
</configuration>
</plugin>
I opened generated .nar in ./target/ - it does contain "/lib/amd64-Linux-gpp/jni/libnative-wrapper-0.1.0-SNAPSHOT.so". The other nar (with java classes) contains "/META-INF/nar/some.native.wrapper/native-wrapper/nar.properties".
main-module's pom:
...
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>native-wrapper</artifactId>
<version>${project.version}</version>
<type>nar</type>
</dependency>
...
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.0.0-rc-2</version>
<extensions>true</extensions>
</plugin>
If I remove nar-maven-plugin plugin from main-module's pom, maven does not find any classes from native-wrapper module.
How can I make nar find the lib?