Archetypes

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

JBehave Web offers archetypes for several usecases:

  • jbehave-web-selenium-flash-archetype: use Selenium to verify Flash-based behaviour.
  • jbehave-web-selenium-groovy-pico-archetype: use Selenium to verify web behaviour, using Groovy for writing steps and Pico for dependency injection.
  • jbehave-web-selenium-java-spring-archetype: use Selenium to verify web behaviour, using Java for writing step and Spring for dependency injection.

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-stories
  • 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.