title: Can't override a maven dependency from third party lib -NiFi
body: <p>I have been working on creating a custom NIFI processor. I am trying to use the luwak search library, which uses Lucene 6.5.0.  However, the NiFi libs, seem to use Lucene 4.10.4.  I have tried all kinds of things with the pom file, but can't get it to override the NiFi 4.10.4 lib when I build the nar file. Highly likely this is user error. I just can't for the life of me figure out what it is. Runs fine in my IDE, but when I build the artifact (NAR), I can see that the 4.10.4 libs are there, but not some of the 6.5.0 that Luwak needs. Any help would be greatly appreciated. </p>
  
  <p>Reading an research made it seem like if I specifically put the Lucene versions for libs I needed in the pom with DependencyMangement that it would work. Also tried exclusions (also shown). </p>
  
  <p><strong>EDITED</strong>: Tried what @Rob suggested and removed pom
  import. However, still having the same issue. Updated Pom Example</p>
  
  <p><strong>Maven Dependency Tree:</strong></p>
  
  <pre><code>    [INFO] gov.pnnl.nifi:nifi-streamqry-nar:nar:1.3
  [INFO] \- gov.pnnl.nifi:nifi-streamqry-processors:jar:1.3:compile
  [INFO]    \- com.github.flaxsearch:luwak:jar:1.5.0:compile
  [INFO]       +- org.apache.lucene:lucene-core:jar:4.10.4:compile (version managed from 6.5.0)
  [INFO]       +- org.apache.lucene:lucene-memory:jar:6.5.0:compile
  [INFO]       |  \- (org.apache.lucene:lucene-core:jar:4.10.4:compile - version managed from 6.5.0; omitted for duplicate)
  [INFO]       +- org.apache.lucene:lucene-analyzers-common:jar:4.10.4:compile (version managed from 6.5.0)
  [INFO]       |  \- (org.apache.lucene:lucene-core:jar:4.10.4:compile - version managed from 6.5.0; omitted for duplicate)
  [INFO]       +- org.apache.lucene:lucene-queries:jar:6.5.0:compile
  [INFO]       |  \- (org.apache.lucene:lucene-core:jar:4.10.4:compile - version managed from 6.5.0; omitted for duplicate)
  [INFO]       \- org.apache.lucene:lucene-queryparser:jar:4.10.4:compile (version managed from 6.5.0)
  [INFO]          \- (org.apache.lucene:lucene-core:jar:4.10.4:compile - version managed from 6.5.0; omitted for duplicate)
  </code></pre>
  
  <p><strong>POM File</strong></p>
  
  <pre><code>&lt;properties&gt;
      &lt;lucene.group&gt;org.apache.lucene&lt;/lucene.group&gt;
      &lt;lucene.version&gt;6.5.0&lt;/lucene.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
              &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
              &lt;version&gt;6.5.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
              &lt;artifactId&gt;lucene-memory&lt;/artifactId&gt;
              &lt;version&gt;${lucene.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
              &lt;artifactId&gt;lucene-queryparser&lt;/artifactId&gt;
              &lt;version&gt;${lucene.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-queries --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
              &lt;artifactId&gt;lucene-analyzers-common&lt;/artifactId&gt;
              &lt;version&gt;${lucene.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
              &lt;artifactId&gt;lucene-queries&lt;/artifactId&gt;
              &lt;version&gt;${lucene.version}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.nifi&lt;/groupId&gt;
          &lt;artifactId&gt;nifi-api&lt;/artifactId&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-queryparser&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-analyzers-common&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.nifi&lt;/groupId&gt;
          &lt;artifactId&gt;nifi-utils&lt;/artifactId&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-queryparser&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-analyzers-common&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.nifi&lt;/groupId&gt;
          &lt;artifactId&gt;nifi-mock&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-queryparser&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-analyzers-common&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-sandbox&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>Exclusions:</strong></p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.nifi&lt;/groupId&gt;
          &lt;artifactId&gt;nifi-api&lt;/artifactId&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-queryparser&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-analyzers-common&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.nifi&lt;/groupId&gt;
          &lt;artifactId&gt;nifi-utils&lt;/artifactId&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-queryparser&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-analyzers-common&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.nifi&lt;/groupId&gt;
          &lt;artifactId&gt;nifi-mock&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-queryparser&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-analyzers-common&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;${lucene.group}&lt;/groupId&gt;
                  &lt;artifactId&gt;lucene-sandbox&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
  </code></pre>