Running JBehave examples.

JDK required: 1.7+
Maven (http://maven.apache.org) required: 3.0+

By default, the examples are meant to be run as part of the JBehave build, as the examples use the latest version of the JBehave code:

git clone git://github.com/jbehave/jbehave-core.git
cd jbehave-core
mvn clean install -Pexamples,gui 
(gui includes the non-headless examples)

Alternatively, to run the examples in standalone mode, i.e. using the latest snaphots published, add to your ~/.m2/settings.xml the following profile:

<profile>
    <id>sonatype</id>
    <activation>
        <activeByDefault>false</activeByDefault>
    </activation>
    <repositories>
        <repository>
          <id>sonatype-public-repository-group</id>
          <name>Sonatype Public Repository Group</name>
          <url>https://oss.sonatype.org/content/groups/public/</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
          <id>sonatype-public-repository-group</id>
          <name>Sonatype Public Repository Group</name>
          <url>https://oss.sonatype.org/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
    </pluginRepositories>
</profile>

(You may also need to add a proxy if behind a firewall
<proxy>
    <id>https-proxy</id>
    <active>true</active>
    <protocol>https</protocol>
    <username>[username]</username>
    <password>[password]</password>
    <host>[host]</host>
    <port>[port]</port>
</proxy>
)

and build with additional profile from examples:

git clone git://github.com/jbehave/jbehave-core.git
cd jbehave-core/examples
mvn clean install -Psonatype

Using the sonatype profile will enable mvn to get the latest snapshot of the parent POM for the examples.

You only need to use the sonatype profile once, because once retrieved the parent POM will be cached in your local repo.

Once you've cached the parent POM, you can run the examples using a fixed version of JBehave:

mvn clean install -Djbehave.version=3.9

 