I am pretty new with Apache Nifi and NARs in general. I am creating a custom processor NAR project which needs to reference classes from the jars present in another NAR file. I don't have access to the project(source code) which has generated this NAR. So I am trying to include this NAR file as a maven dependency. This is similar to how you would add an external/local jar as a maven dependency. What would be the right way to achieve this?
NOTE: My custom project is a child project of "nifi-nar-bundles" so it will inherit the "nar-maven-plugin"
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
<version>1.11.4</version>
</parent>
I am using eclipse with its maven plugin and have tried few things:
#1
<dependency>
<groupId>com.group.test</groupId>
<artifactId>test-nar</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<type>nar</type>
<systemPath>C:\test-nar-1.0.0.nar</systemPath>
</dependency>
This does not add the NAR file under "Maven Dependencies" in eclipse. However if I remove <type>nar</type>
it shows the NAR file under "Maven Dependencies" but does not put its jars in the classpath.
#2
I installed the NAR in my local maven repository with packaging as "nar" using below command:
mvn install:install-file -Dfile=test-nar-1.0.0.nar -DgroupId=com.group.test -DartifactId=test-nar -Dversion=1.0.0 -Dpackaging=nar
and then put it as a dependency in the pom.xml
file as below:
<dependency>
<groupId>com.group.test</groupId>
<artifactId>test-nar</artifactId>
<version>1.0.0</version>
<type>nar</type>
</dependency>
This does not add the NAR file under "Maven Dependencies" in eclipse either.