title: How to get JBehave to include test dependency jars when running in Maven?
body: <p>I've got a simple-enough project that I'm trying to test with JBehave core, and doing things in a maven-kosher fashion (that is production under src/main, test under src/test, integration testing stuff under an added path of src/it/{java,resources}, and test dependencies scoped with test). Getting this all running together seems rather harder than it should be.</p>
  
  <p>My case is a little different because my code is in src/it/java, and resources in src/it/resources. Having configured those in maven, Eclipse runs the stories just fine - the problem is with Maven.</p>
  
  <p>Currently my problem is that it doesn't see mockito (or other test dependencies) when running (mvn -X). Even editing a working example and adding a test dependency doesn't include it.</p>
  
  <p>I've been able to bodge it into working by sticking my test dependencies within the plugin xml blob, but obviously I don't want to repeat myself like that.</p>
  
  <p>The relevant parts of the build file (without the manually specified dependency hack) are:</p>
  
  <p></p>
  
  <pre><code>&lt;testResources&gt;
      &lt;testResource&gt;
          &lt;directory&gt;src/test/resources&lt;/directory&gt;
          &lt;filtering&gt;false&lt;/filtering&gt;
          &lt;includes&gt;
              &lt;include&gt;**/*&lt;/include&gt;
          &lt;/includes&gt;
      &lt;/testResource&gt;
      &lt;testResource&gt;
          &lt;directory&gt;src/it/resources&lt;/directory&gt;
          &lt;filtering&gt;false&lt;/filtering&gt;
          &lt;includes&gt;
              &lt;include&gt;**/*&lt;/include&gt;
          &lt;/includes&gt;
      &lt;/testResource&gt;
  &lt;/testResources&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>  &lt;plugin&gt;
      &lt;groupId&gt;org.jbehave&lt;/groupId&gt;
      &lt;artifactId&gt;jbehave-maven-plugin&lt;/artifactId&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;id&gt;embeddable-stories&lt;/id&gt;
          &lt;phase&gt;integration-test&lt;/phase&gt;
          &lt;configuration&gt;
            &lt;includes&gt;
              &lt;include&gt;**/*Story.java&lt;/include&gt;
            &lt;/includes&gt;
            &lt;ignoreFailureInStories&gt;false&lt;/ignoreFailureInStories&gt;
            &lt;ignoreFailureInView&gt;false&lt;/ignoreFailureInView&gt;
            &lt;scope&gt;test&lt;/scope&gt;
            &lt;testSourceDirectory&gt;src/it/java&lt;/testSourceDirectory&gt;
          &lt;/configuration&gt;
          &lt;goals&gt;
            &lt;goal&gt;run-stories-as-embeddables&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
    &lt;/plugin&gt;
  </code></pre>
  
  <p>Ideas?</p>