0

I have following project structure

nifi-basename-bundle  
    ├── nifi-basename-nar  
    │   └── pom.xml  
    ├── nifi-basename-processors  
    │   ├── pom.xml  
    |   ├── libs  
    |   |   └── xyz.jar
    │   └── src  
    │       ├── main  
    │       │   ├── java  
    │       │   │   └── org.apache.nifi.processors.basename  
    │       │   │       └── MyProcessor.java  
    │       │   └── resources  
    │       │       ├── META-INF  
    │       │       │   └── services  
    │       │               └── org.apache.nifi.processor.Processor  
    │       └── test  
    │           └── java  
    │               └── org.apache.nifi.processors.basename  
    │                   └── MyProcessorTest.java  
    └── pom.xml  

My nifi-basename-nar project has a dependency of nifi-basename-processors project as below:

<dependency>
    <groupId>com.example.prj</groupId>
    <artifactId>nifi-basename-processors</artifactId>
    <version>1.0.0</version>
</dependency>

I have added a dependency of an external jar in the pom.xml of nifi-basename-processors project like below and my custom processor is referring to classes in this jar:

<dependency>
    <groupId>com.example.prj</groupId>
    <artifactId>test1</artifactId>
    <version>1.0.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/libs/xyz.jar</systemPath>
</dependency>

Once I build the project using maven clean install, the nar generated under project nifi-basename-nar does not have the xyz.jar bundled inside it. Hence it throws NoClassDefFoundError and nifi cannot start when this custom nar is deployed in nifi.

What is the correct way to handle this requirement?

user1144004
  • 183
  • 3
  • 4
  • 21
  • 1
    you specified the scope 'system' that means that library will be provided at runtime by jdk or system. – daggett Sep 01 '21 at 17:11
  • @daggett I need to have the external jars bundled in the NAR when its built. If not 'system' then what is the correct way to achieve this? – user1144004 Sep 01 '21 at 18:21
  • very similar to your question: https://stackoverflow.com/a/2230464/1276664 – daggett Sep 01 '21 at 19:17

0 Answers0