title: Maven 2 - different dependency versions in test and compile
body: <p>I have project that depends on commons-httpclient [2.0] (compile).</p>
  <p>I would like to write some jbehave tests - jbehave-core 3.4.5 (test).
  Both this dependencies depend on commons-lang but in different versions - 1.0.1 and 2.5.</p>
  <p><img src="https://i.stack.imgur.com/eUC76.png" alt="dependency" /></p>
  <p>When I execute <em>mvn package</em> I get [BUID FAILURE] in tests section.
  There is an exception for my testcase in surefire-plugin output:</p>
  <pre><code>java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.substringBeforeLast(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  </code></pre>
  <p>As I looked in source code - in commons-lang 1.0.1 - indeed, there is no StringUtils.substringBeforeLast(...) method.
  Why maven uses commons-lang from commons-httpclient (compile) and not from jbehave-core in testing?</p>
  <p>I can't afford to exclude this conflicting dependency in commons-httpclient so it must stay in compile time.</p>
  <p>So how can this be resolved - commons-lang 2.5 version in testing and 1.0.1 in compile time?</p>