Main nar file not in classPath of dependent project.

30 views
Skip to first unread message

Karsten Spang

unread,
Oct 1, 2019, 1:12:53 AM10/1/19
to NAR Maven plugin
I have a JNI shared library written in C and the corresponding Java class in one maven project, and an application using that class in another project. I use the nar-maven-plugin for handling the JNI.
Versions:
Maven 3.6.0
Java 12
nar plugin 3.6.0

The problem is while <type>nar</type> does the trick for dependency resolution, the nar file containing the Java code is not included in the compilation classPath of the dependent project.

Karsten Spang

unread,
Oct 1, 2019, 5:53:54 AM10/1/19
to NAR Maven plugin
The solution is to configure the plugin in the dependent project, e.g. the code in the it0025 example:
      <plugin>
       
<groupId>com.github.maven-nar</groupId>
       
<artifactId>nar-maven-plugin</artifactId>
       
<version>${nar-plugin.version}</version>
       
<extensions>true</extensions>
       
<executions>
         
<execution>
           
<id>nar-download</id>
           
<goals>
             
<goal>nar-download</goal>
           
</goals>
         
</execution>
         
<execution>
           
<id>nar-test-unpack</id>
           
<goals>
             
<goal>nar-test-unpack</goal>
           
</goals>
         
</execution>
         
<execution>
           
<id>nar-integration-test</id>
           
<goals>
              <goal>nar-integration-test</goal>
           
</goals>
         
</execution>
       
</executions>
     
</plugin>

Reply all
Reply to author
Forward
0 new messages