I have a fairly simple project that I am trying to test using the JBehave kernel, and am doing something in maven-kosher (this is production under src / main, test under src / test, testing integration on the added path src / it / { java, resources} and test dependencies covered by the test). How it all works seems more complicated than it should be.
My case is a little different because my code is in src / it / java and the resources are in src / it / resources. By configuring those that were in maven, Eclipse does a great job of storytelling - a problem with Maven.
Currently my problem is that when I start (mvn -X) it does not see mockito (or other test dependencies). Even editing a working example and adding a test dependency does not include it.
I managed to incorporate it into the work by inserting my test dependencies into the xml blob plugin, but obviously I don't want to repeat this.
Relevant parts of the assembly file (without routine hacking of dependencies):
<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?
Dave LeBlanc
source share