How to get JBehave to include dependency banners on startup in Maven?

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?

+7
source share
2 answers

The plugin has a scope property, which defaults to compile , I suppose you should change it to test . Consult the documentation .

Also, here is a good point why compile by default.

+4
source

According to the jbehave maven plugin,

When using the JBehave Maven Plugin, and depending on the rest of your POM configuration, you may need to add Apache log4j as a plugin dependency (as against a project dependency) if you find that it cannot load its classes

Could you face the same problem?

+2
source

All Articles