Archetypes

Archetypes are Maven project templates that can allow a quick and easy setup of new JBehave modules.

JBehave offers archetypes for several usecases:

  • jbehave-simple-archetype: the simplest form to run stories
  • jbehave-groovy-archetype: use steps written in Groovy
  • jbehave-guice-archetype: use Guice support
  • jbehave-pico-archetype: use Pico support
  • jbehave-spring-archetype: use Spring support

To generate a project from an archetype, first you need to select the archetype, then provide the information to create the concrete project from the archetype. This information includes:

  • your project groupId: e.g. com.example.app
  • your project artifactId: e.g. app-core
  • your project version: e.g. 1.0-SNAPSHOT
  • your project package: by default, a proposed one will be derived from the groupId

Generating a project from command-line

To select a project from command-line, you can invoke:

Choose an archetype from the list:

Provide the project information:

Using a specific Archetype Catalog

You can also specify the path the archetype-catalog.xml which can be found in the binary distribution, in the archetypes directory:

If you are using Nexus 1.9 or above you don't need to specify the archetype catalog as it will automatically generate it for you. Then all you need is to search for archetypes with group org.jbehave. The Maven Central archetype catalog is also periodically updated, although perhaps not with the same frequency that you may require.

Generating a project from Eclipse

Eclipse with m2e plugin allows the creation of Maven project from archetypes, easily filtering the archetype you are interested in.