Archetypes are Maven project templates that can allow a quick and easy setup of new JBehave modules.
JBehave offers archetypes for several usecases:
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:
To select a project from command-line, you can invoke:
mvn archetype:generate -Dfilter=org.jbehave:jbehave |
Choose an archetype from the list:
[INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode Choose archetype: 1: remote -> org.jbehave:jbehave-groovy-archetype (-) 2: remote -> org.jbehave:jbehave-guice-archetype (-) 3: remote -> org.jbehave:jbehave-pico-archetype (-) 4: remote -> org.jbehave:jbehave-simple-archetype (-) 5: remote -> org.jbehave:jbehave-spring-archetype (-) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : |
Provide the project information:
Define value for property 'groupId': : com.example.app Define value for property 'artifactId': : app-core [INFO] Using property: version = 1.0-SNAPSHOT Define value for property 'package': com.example.app: [INFO] Using property: jbehaveCoreVersion = 3.5 [INFO] Using property: jbehaveSiteVersion = 3.1.1 Confirm properties configuration: groupId: com.example.app artifactId: app-core version: 1.0-SNAPSHOT package: com.example.app jbehaveCoreVersion: 3.5 jbehaveSiteVersion: 3.1.1 Y: |
You can also specify the path the archetype-catalog.xml which can be found in the binary distribution, in the archetypes directory:
mvn archetype:generate -DarchetypeCatalog=file://path/to/catalog |
Eclipse with m2e plugin allows the creation of Maven project from archetypes, easily filtering the archetype you are interested in.