<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Building Custom NAR - How to add config sub directory into NAR? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Building-Custom-NAR-How-to-add-config-sub-directory-into-NAR/m-p/413888#M254261</link>
    <description>&lt;P&gt;Thank you André,&lt;/P&gt;&lt;P&gt;This led to the right direction.&lt;BR /&gt;Since the configuration file is required by a third party JAR that I don't build, the way to solve it was to add a src/main/resources path to the myProcessor-nar directory instead of the myProcessor-processor directory. The nar directory doesn't include a src/main/java but you can nevertheless add a src/main/resources path and add subfolders/files to it, e.g. NAR-INF/data/config.ini.&lt;/P&gt;&lt;P&gt;Maven will copy automatically everything under src/main/resources to the target, hence it's not necessary to add the resources snippet to the pom.xml.&lt;/P&gt;&lt;P&gt;So, now NiFi's work/nar/extensions/myProcessor-nar-1.0.nar-unpacked/NAR-INF folder contains my subfolder/file data/config.ini every time NiFi unpacks the NAR.&lt;/P&gt;&lt;P&gt;I found this article helpful that explains the parts of a NAR and the three pom.xml files:&amp;nbsp;&lt;A href="https://www.javahotchocolate.com/notes/nifi-project.html" target="_blank"&gt;https://www.javahotchocolate.com/notes/nifi-project.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/114383"&gt;@vafs&lt;/a&gt;!&lt;/P&gt;</description>
    <pubDate>Fri, 17 Apr 2026 10:20:21 GMT</pubDate>
    <dc:creator>karsten</dc:creator>
    <dc:date>2026-04-17T10:20:21Z</dc:date>
    <item>
      <title>Building Custom NAR - How to add config sub directory into NAR?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-Custom-NAR-How-to-add-config-sub-directory-into-NAR/m-p/413870#M254256</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I have built a custom processor that uses another java library. This 3rd party JAR requires one sub directory ./data containing a file named config.ini.&lt;/P&gt;&lt;P&gt;I put the NAR into the ./extensions subfolder of NiFi. When NiFi starts up, it unpacks the NAR &amp;nbsp;into the folder&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;nifi/work/nar/extensions/my-processor-nar-1.0.nar-unpacked/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This folder contains a subfolder NAR-INF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And this NAR-INF is the location where my subfolder "data" needs to be copied. When I manually copy the folder with the containing config file into NAR-INF, the processor works fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But after the next restart of NiFi the subfolder is missing again.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need the structure of the unpacked NAR to include this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;nifi/work/nar/extensions/my-processor-nar-1.0.nar-unpacked/data/config.ini&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone have an example how I can build the NAR so that this subfolder and file are included?&lt;BR /&gt;Like an example pom.xml snippet?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;BR /&gt;Karsten&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2026 07:44:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-Custom-NAR-How-to-add-config-sub-directory-into-NAR/m-p/413870#M254256</guid>
      <dc:creator>karsten</dc:creator>
      <dc:date>2026-04-15T07:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Building Custom NAR - How to add config sub directory into NAR?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-Custom-NAR-How-to-add-config-sub-directory-into-NAR/m-p/413872#M254258</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/137450"&gt;@karsten&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should not include anything under the unpacked folder, after a restart it will always remove the content and the new unpack will put only the nar content.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, you can use the resources path for this, for example:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;├── your-nifi-custom-processor
│   ├── pom.xml
│   └── src
│       └── main
│           ├── java
│           ├── resources
│               └── data
│           │       └── config.ini
│           └── webapp&lt;/LI-CODE&gt;&lt;P&gt;This is based on the examples here:&amp;nbsp;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html" target="_blank" rel="noopener"&gt;https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You should include all the information on your pom.xml. The resources part should look like this:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;resources&amp;gt;
        &amp;lt;resource&amp;gt;
            &amp;lt;directory&amp;gt;src/main/resources&amp;lt;/directory&amp;gt;
            &amp;lt;includes&amp;gt;
                &amp;lt;include&amp;gt;**/*&amp;lt;/include&amp;gt;
            &amp;lt;/includes&amp;gt;
        &amp;lt;/resource&amp;gt;
    &amp;lt;/resources&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Also found this interesting blog with the same explanation:&amp;nbsp;&lt;A href="https://medium.com/@mr.sinchan.banerjee/nifi-custom-processor-series-part-1-writing-your-first-custom-processor-dd7aa901c896" target="_blank" rel="noopener"&gt;https://medium.com/@mr.sinchan.banerjee/nifi-custom-processor-series-part-1-writing-your-first-custom-processor-dd7aa901c896&lt;/A&gt;&lt;BR /&gt;This is not Cloudera or NiFi official, but it could help you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2026 18:56:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-Custom-NAR-How-to-add-config-sub-directory-into-NAR/m-p/413872#M254258</guid>
      <dc:creator>vafs</dc:creator>
      <dc:date>2026-04-15T18:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Building Custom NAR - How to add config sub directory into NAR?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-Custom-NAR-How-to-add-config-sub-directory-into-NAR/m-p/413888#M254261</link>
      <description>&lt;P&gt;Thank you André,&lt;/P&gt;&lt;P&gt;This led to the right direction.&lt;BR /&gt;Since the configuration file is required by a third party JAR that I don't build, the way to solve it was to add a src/main/resources path to the myProcessor-nar directory instead of the myProcessor-processor directory. The nar directory doesn't include a src/main/java but you can nevertheless add a src/main/resources path and add subfolders/files to it, e.g. NAR-INF/data/config.ini.&lt;/P&gt;&lt;P&gt;Maven will copy automatically everything under src/main/resources to the target, hence it's not necessary to add the resources snippet to the pom.xml.&lt;/P&gt;&lt;P&gt;So, now NiFi's work/nar/extensions/myProcessor-nar-1.0.nar-unpacked/NAR-INF folder contains my subfolder/file data/config.ini every time NiFi unpacks the NAR.&lt;/P&gt;&lt;P&gt;I found this article helpful that explains the parts of a NAR and the three pom.xml files:&amp;nbsp;&lt;A href="https://www.javahotchocolate.com/notes/nifi-project.html" target="_blank"&gt;https://www.javahotchocolate.com/notes/nifi-project.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/114383"&gt;@vafs&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 10:20:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-Custom-NAR-How-to-add-config-sub-directory-into-NAR/m-p/413888#M254261</guid>
      <dc:creator>karsten</dc:creator>
      <dc:date>2026-04-17T10:20:21Z</dc:date>
    </item>
  </channel>
</rss>

