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.
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.
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.
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.
The relevant parts of the build file (without the manually specified dependency hack) are:
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*</include>
</includes>
</testResource>
<testResource>
<directory>src/it/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*</include>
</includes>
</testResource>
</testResources>
...
<plugin>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-maven-plugin</artifactId>
<executions>
<execution>
<id>embeddable-stories</id>
<phase>integration-test</phase>
<configuration>
<includes>
<include>**/*Story.java</include>
</includes>
<ignoreFailureInStories>false</ignoreFailureInStories>
<ignoreFailureInView>false</ignoreFailureInView>
<scope>test</scope>
<testSourceDirectory>src/it/java</testSourceDirectory>
</configuration>
<goals>
<goal>run-stories-as-embeddables</goal>
</goals>
</execution>
</executions>
</plugin>
Ideas?