JBehave Examples

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 repository :

Running Examples with latest snapshot

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.

To run the GUI example too (requires non-headless mode):

Running Examples against a fixed version

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, checkout project source as above and install the parent POM:

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.

Running Examples via Ant

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.