JBehave was developed as behaviour and example driven. As such the examples are an integral part of the build, verifying the correctness of the behaviour. They are not released as artifacts, but they can be run easily browsed or checked out from source control:
To build core modules and run examples with Maven:
The 'examples' profile instructs Maven to build the releasable modules and to verify their behaviour by running the examples afterwards.
In some cases, it may be necessary to run the examples against a known version of JBehave.
Note that running the examples in 'standalone' mode requires the JBehave parent POM to be present, as it contains the information about the development setup of the project, e.g. the compiler, the layout of the source, etc.To ensure JBehave parent POM is available, two approaches are possible. One is to check out project source as above and install the parent POM:
The other approach is to fetch the parent POM from the snapshots remote repository. For this, you need to add the following profile to your $HOME/.m2/settings.xml
and run with additional profile
As with any Maven artifact that is not expected to change, the build or retrieval is only required once, as it will be cached in the local repository. So, once you've built the JBehave parent POM from source or retrieved it from the snapshots repository, you don't need to do it again, unless you think it needs to be updated.While the basic infrastructure of the build is Maven-based, the examples also show how to run stories via Ant. The trader example has an Ant build.xml which shows its use. Note that it requires the Maven Ant Tasks jar to be present in the $ANT_HOME/lib directory in order to retrieve the dependency information from the Maven POM.