title: NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor
body: <p>I have a project (<code>main</code>) that builds and executes fine.</p>
  
  <p>I have another project (<code>envelope</code>), with a dependency on the <code>main</code> project, which builds as a fat jar (<code>jar-with-dependencies</code> using <code>maven assembly plugin</code>), which I then run from ALM (test management software)</p>
  
  <p>When I run the fat jar, I'm getting this error:</p>
  
  <blockquote>
    <p>NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor</p>
  </blockquote>
  
  <p>Google says this is caused by a conflict between versions of <code>com.google.guava</code> (different versions used at compile-time and at runtime?).</p>
  
  <p>I've put a dependency to guava 28.1 at the very top of my <code>envelope</code> project's pom.xml, and put exclusions for guava under ALL other dependencies there. Yet I'm still getting this error at runtime!</p>
  
  <p>How do I know why it does that? How do I prevent it from doing that? And how do I solve the error?</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p><code>mvn dependency:tree</code> shows only one dependency on guava.</p>
  
  <p><code>External libraries</code> show only one version of guava.</p>
  
  <p><code>Ctrl+N</code> shows two instances of the MoreExecutors class - one from the latest guava version, and one form a deep transient dependency on <code>org.apache.curator</code> artifact which contains the <code>shaded.com.google.common.util.concurrent.MoreExecutors</code> class.</p>
  
  <p>I tried excluding this dependency in my pom.xml, but then I get an error saying that the Curator failed to find the shaded.&lt;..>.MoreExecutors class. So could this be the culprit, or is it something else?</p>
  
  <p><strong>Setup</strong></p>
  
  <pre><code>-Java 11.0.3
  -Groovy 2.5.8
  -Spock 1.3-groovy-2.5
  -IntelliJ IDEA 2019.1
  -Maven 3.5
  -Maven compiler plugin
  -Maven build helper plugin
  -Maven assembly plugin 3.8.1
  </code></pre>