title: Changing libraryDependencies for specific code segments in SBT?
body: <p>I am building a Spark project with SBT.</p>
  
  <p>When I include a <em>libraryDependencies</em>, one part of the program will work, the other part will throw an Exception (because of a wrong version specified in the <code>libraryDependencies</code>). When I remove <code>libraryDependencies</code> it is the other way around.</p>
  
  <p>Is there a way to dynamically change the <code>libraryDependencies</code> (changing a version) at compile or runtime?</p>
  
  <p>Similar to that (pseudocode):</p>
  
  <pre><code>libraryDependencies.set("org.apache.hadoop.hadoop-client", "2.0.0-cdh4.5.0")
  
  // here comes the code depending on hadoop-client" % "2.0.0-cdh4.5.0
  
  libraryDependencies.set("org.apache.hadoop.hadoop-client", "1.0.4")
  
  // here comes the code depending on hadoop-client" % "1.0.4
  </code></pre>
  
  <p>Could this be done by <a href="http://www.scala-sbt.org/release/docs/Getting-Started/Scopes.html" rel="nofollow">scoping</a>?</p>