<?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 Maven nar plugin looks to not bundle all the dependancies in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Maven-nar-plugin-looks-to-not-bundle-all-the-dependancies/m-p/125605#M51395</link>
    <description>&lt;P&gt;I have a &lt;A href="https://github.com/SebastianCarroll/nifi-box-connector/blob/f/45-maintain-state/nifi-boxconnector-processors/src/main/java/org/hortonworks/processors/boxconnector/ListBox.java"&gt;custom NiFi processor&lt;/A&gt; that worked great up until me trying use a distributedMapCache. I tried to include it like:&lt;/P&gt;&lt;PRE&gt;import org.apache.nifi.distributed.cache.client.DistributedMapCacheClient;
...
public class ListBox extends AbstractListProcessor {
...
    public static final PropertyDescriptor DISTRIBUTED_CACHE_SERVICE = new PropertyDescriptor.Builder()
            .name("Distributed Cache Service")
            .description("Specifies the Controller Service that should be used to maintain state about what has been pulled from HDFS so that if a new node "
                    + "begins pulling data, it won't duplicate all of the work that has been done.")
            .required(false)
            .identifiesControllerService(DistributedMapCacheClient.class)
            .build();
&lt;/PRE&gt;&lt;P&gt;But then when I mvn clean install and copy the nar over I get the following error:&lt;/P&gt;&lt;PRE&gt;java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider org.hortonworks.processors.boxconnector.ListBox could not be instantiated
        at java.util.ServiceLoader.fail(ServiceLoader.java:232) ~[na:1.8.0_91]
        at java.util.ServiceLoader.access$100(ServiceLoader.java:185) ~[na:1.8.0_91]
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) ~[na:1.8.0_91]
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) ~[na:1.8.0_91]
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480) ~[na:1.8.0_91]
        at org.apache.nifi.nar.ExtensionManager.loadExtensions(ExtensionManager.java:116) ~[nifi-nar-utils-1.1.0.jar:1.1.0]
        at org.apache.nifi.nar.ExtensionManager.discoverExtensions(ExtensionManager.java:97) ~[nifi-nar-utils-1.1.0.jar:1.1.0]
        at org.apache.nifi.NiFi.&amp;lt;init&amp;gt;(NiFi.java:139) ~[nifi-runtime-1.1.0.jar:1.1.0]
        at org.apache.nifi.NiFi.main(NiFi.java:262) ~[nifi-runtime-1.1.0.jar:1.1.0]
Caused by: java.lang.NoClassDefFoundError: org/apache/nifi/distributed/cache/client/DistributedMapCacheClient
&lt;/PRE&gt;&lt;P&gt;I also have the dependancy configured in my &lt;A href="https://github.com/SebastianCarroll/nifi-box-connector/blob/f/45-maintain-state/nifi-boxconnector-processors/pom.xml"&gt;pom.xml&lt;/A&gt; file:&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.nifi&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;nifi-distributed-cache-client-service-api&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;&lt;/PRE&gt;&lt;P&gt;If I copy over the distributed map cache nar before bundling it works fine. Is there somewhere else I have to list the dependancy to get it bundled into the nar?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2017 08:35:21 GMT</pubDate>
    <dc:creator>scarroll</dc:creator>
    <dc:date>2017-01-12T08:35:21Z</dc:date>
    <item>
      <title>Maven nar plugin looks to not bundle all the dependancies</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Maven-nar-plugin-looks-to-not-bundle-all-the-dependancies/m-p/125605#M51395</link>
      <description>&lt;P&gt;I have a &lt;A href="https://github.com/SebastianCarroll/nifi-box-connector/blob/f/45-maintain-state/nifi-boxconnector-processors/src/main/java/org/hortonworks/processors/boxconnector/ListBox.java"&gt;custom NiFi processor&lt;/A&gt; that worked great up until me trying use a distributedMapCache. I tried to include it like:&lt;/P&gt;&lt;PRE&gt;import org.apache.nifi.distributed.cache.client.DistributedMapCacheClient;
...
public class ListBox extends AbstractListProcessor {
...
    public static final PropertyDescriptor DISTRIBUTED_CACHE_SERVICE = new PropertyDescriptor.Builder()
            .name("Distributed Cache Service")
            .description("Specifies the Controller Service that should be used to maintain state about what has been pulled from HDFS so that if a new node "
                    + "begins pulling data, it won't duplicate all of the work that has been done.")
            .required(false)
            .identifiesControllerService(DistributedMapCacheClient.class)
            .build();
&lt;/PRE&gt;&lt;P&gt;But then when I mvn clean install and copy the nar over I get the following error:&lt;/P&gt;&lt;PRE&gt;java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider org.hortonworks.processors.boxconnector.ListBox could not be instantiated
        at java.util.ServiceLoader.fail(ServiceLoader.java:232) ~[na:1.8.0_91]
        at java.util.ServiceLoader.access$100(ServiceLoader.java:185) ~[na:1.8.0_91]
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) ~[na:1.8.0_91]
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) ~[na:1.8.0_91]
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480) ~[na:1.8.0_91]
        at org.apache.nifi.nar.ExtensionManager.loadExtensions(ExtensionManager.java:116) ~[nifi-nar-utils-1.1.0.jar:1.1.0]
        at org.apache.nifi.nar.ExtensionManager.discoverExtensions(ExtensionManager.java:97) ~[nifi-nar-utils-1.1.0.jar:1.1.0]
        at org.apache.nifi.NiFi.&amp;lt;init&amp;gt;(NiFi.java:139) ~[nifi-runtime-1.1.0.jar:1.1.0]
        at org.apache.nifi.NiFi.main(NiFi.java:262) ~[nifi-runtime-1.1.0.jar:1.1.0]
Caused by: java.lang.NoClassDefFoundError: org/apache/nifi/distributed/cache/client/DistributedMapCacheClient
&lt;/PRE&gt;&lt;P&gt;I also have the dependancy configured in my &lt;A href="https://github.com/SebastianCarroll/nifi-box-connector/blob/f/45-maintain-state/nifi-boxconnector-processors/pom.xml"&gt;pom.xml&lt;/A&gt; file:&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.nifi&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;nifi-distributed-cache-client-service-api&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;&lt;/PRE&gt;&lt;P&gt;If I copy over the distributed map cache nar before bundling it works fine. Is there somewhere else I have to list the dependancy to get it bundled into the nar?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 08:35:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Maven-nar-plugin-looks-to-not-bundle-all-the-dependancies/m-p/125605#M51395</guid>
      <dc:creator>scarroll</dc:creator>
      <dc:date>2017-01-12T08:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Maven nar plugin looks to not bundle all the dependancies</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Maven-nar-plugin-looks-to-not-bundle-all-the-dependancies/m-p/125606#M51396</link>
      <description>&lt;P&gt;There is a specific way that processors and controller services are linked together....&lt;/P&gt;&lt;P&gt;Your processor JAR project should have a provided dependency on the API of the controller service, and your processor NAR project should have a NAR dependency on the API NAR.&lt;/P&gt;&lt;P&gt;Check out these resources for examples:&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/NIFI/Maven+Projects+for+Extensions#MavenProjectsforExtensions-LinkingProcessorsandControllerServices" target="_blank"&gt;https://cwiki.apache.org/confluence/display/NIFI/Maven+Projects+for+Extensions#MavenProjectsforExtensions-LinkingProcessorsandControllerServices&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/bbende/nifi-dependency-example" target="_blank"&gt;https://github.com/bbende/nifi-dependency-example&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 22:48:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Maven-nar-plugin-looks-to-not-bundle-all-the-dependancies/m-p/125606#M51396</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2017-01-12T22:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Maven nar plugin looks to not bundle all the dependancies</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Maven-nar-plugin-looks-to-not-bundle-all-the-dependancies/m-p/125607#M51397</link>
      <description>&lt;P&gt;Specifically, in your processor POM (which you list above), Bryan is saying that under that dependency you should have a &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt; line, and in your NAR POM you should include:&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
  &amp;lt;groupId&amp;gt;org.apache.nifi&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;nifi-standard-services-api-nar&amp;lt;/artifactId&amp;gt;
  &amp;lt;type&amp;gt;nar&amp;lt;/type&amp;gt;
&amp;lt;/dependency&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jan 2017 22:52:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Maven-nar-plugin-looks-to-not-bundle-all-the-dependancies/m-p/125607#M51397</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2017-01-12T22:52:15Z</dc:date>
    </item>
  </channel>
</rss>

