title: How to exclude a dependency for a specific scope only?
body: <p>I have two dependencies in my pom called A and B. Both A and B have a transitive dependency on an artifact C (cassandra-all). A and B use difference versions of C. Dependency A is the artifact <em>astyanax</em>.
  <br><br> 
  I want to keep the <strong>Version</strong> of C that comes with B. I accomplished by adding an exclusion in A (Astyanax) for C.</p>
  
  <p>Unfortunately, I want the scope of B to be 'test'. This means that with the exclusion in A, C will not be included outside of the test scope.  </p>
  
  <p>How can I resolve this?  Can an exclusion be for a specific scope only?  Alternatively, can I specify which version to use for a transitive dependency?</p>
  
  <p><hr>
  <strong>Example:</strong> <br>
  Here is what my pom looks like:</p>
  
  <p><strong>Artifact A (astyanax) with exclusion of dependency on Artifact C (called cassandra-all)</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.netflix.astyanax&lt;/groupId&gt;
          &lt;artifactId&gt;astyanax&lt;/artifactId&gt;
          &lt;version&gt;1.0.4&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.apache.cassandra&lt;/groupId&gt;
                  &lt;artifactId&gt;cassandra-all&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;  
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.cassandraunit&lt;/groupId&gt;
          &lt;artifactId&gt;cassandra-unit&lt;/artifactId&gt;
          &lt;version&gt;1.1.1.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>So concretely: how can I include cassandra-all when I run code outside of the test scope and still keep the scope of cassandraunit test only?</p>