JBehave supports accessing the Embedder functionality via Maven goals:
Maven goals support the following properties:
null
In addition, the unpack-view-resources goal supports the properties:
An example of a typical Maven plugin usage is:
< plugin > < groupId >org.jbehave</ groupId > < artifactId >jbehave-maven-plugin</ artifactId > < version >[version]</ version > < executions > < execution > < id >run-stories-as-embeddables</ id > < phase >integration-test</ phase > < configuration > < includes > < include >**/*Stories.java</ include > </ includes > < metaFilters > < metaFilter >+author *</ metaFilter > < metaFilter >-skip</ metaFilter > </ metaFilters > < systemProperties > < property > < name >java.awt.headless</ name > < value >true</ value > </ property > </ systemProperties > < ignoreFailureInStories >true</ ignoreFailureInStories > < ignoreFailureInView >false</ ignoreFailureInView > </ configuration > < goals > < goal >run-stories-as-embeddables</ goal > </ goals > </ execution > </ executions > </ plugin > |
The default scope is compile, which means that the stories will be looked up in the POM source directory. If the scope is set to test the stories will be looked up in the POM test source directory.
JBehave uses FreeMarker to generate template-based reports. FreeMarker uses its own version of a logging facade framework which auto-discovers different logging frameworks, notably SLF4J, JDK Logging and Apache Log4J. When using the JBehave Maven Plugin, and depending on the rest of your POM configuration, you may need to add SLF4J Log4J bridge and Apache Log4J2 as Plugin Dependency (as opposed to the Project Dependency) if you find that it's not able to load its classes, e.g.:
< plugin > < groupId >org.jbehave</ groupId > < artifactId >jbehave-maven-plugin</ artifactId > < version >[version]</ version > < executions > <!-- define executions as normal --> </ executions > < dependencies > < dependency > < groupId >org.slf4j</ groupId > < artifactId >log4j-over-slf4j</ artifactId > < version >1.7.32</ version > </ dependency > < dependency > < groupId >org.apache.logging.log4j</ groupId > < artifactId >log4j-slf4j-impl</ artifactId > < version >2.17.0</ version > </ dependency > </ dependencies > </ plugin > |
When using the JBehave Maven Plugin with a Groovy Meta Matcher you need to configure Groovy as Plugin Dependency (as opposed to the Project Dependency):
< plugin > < groupId >org.jbehave</ groupId > < artifactId >jbehave-maven-plugin</ artifactId > < version >[version]</ version > < executions > <!-- define executions as normal --> < metaFilters > < metaFilter >"groovy: lang != 'java'"</ metaFilter > </ metaFilters > </ executions > < dependencies > < dependency > < groupId >org.codehaus.groovy</ groupId > < artifactId >groovy-all</ artifactId > < version >2.4.15</ version > </ dependency > </ dependencies > </ plugin > |