Maven NAR Dependency - Could not resolve dependencies

599 views Asked by At

My Dependencie is built as a nar(which contains java files and a jni wrapper)

<dependency>
        <groupId>jni</groupId>
        <artifactId>jni</artifactId>
        <version>1.0.0-SNAPSHOT</version>
</dependency>

now If I do

mvn clean package

it says Could not resolve dependencies for project java:javatest:jar:1.0.0-SNAPSHOT: Could not find artifact jni:jni:jar:1.0.0-SNAPSHOT

the problem is, that in a project with nar-Packaging the output is named .nar instead of .jar so if I copy the jni.nar in my local repository(~/.m2/repository/jni/jni) and name it jni.jar it works fine.

Any Idea how I could solve that without manually renaming the file?

1

There are 1 answers

5
Milen Dyankov On BEST ANSWER

You probably need to tell Maven your dependency type is different:

<dependency>
        <groupId>jni</groupId>
        <artifactId>jni</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <type>nar</type>
</dependency>

NOTE: I'm guessing the type is "nar" here. Check the POM of the dependency to see what the actual type is.