Hi James,

have you had a look at the examples?

https://github.com/jbehave/jbehave-core/tree/master/examples

They are all Maven-based. In particular, if you are looking for an example of running in test scope, you need to set the 'scope' property to 'test':

https://github.com/jbehave/jbehave-core/tree/master/examples/noughtsandcrosses/pom.xml

If you want the change the test directory, you'll need to set the ' testSourceDirectory' property:

http://jbehave.org/reference/stable/maven-goals.html

And there is no need to use the surefire plugin.

If you decide to do your acceptance testing in a separate Maven module in scope compile (recommended), you can also use a Maven archetype to get you started:

http://jbehave.org/reference/stable/archetypes.html

On 20/09/2012 11:41, James Newhaven wrote:
I am trying to get a JBehave story to execute in Maven it is completely ignoring the JBehave plugin. I've spent several hours using different configurations but it looks like the plugin isn't being executed at all. Any recommendations/tips would be appreciated!

All my JBehave classes live in:  src/at/java

Relevant parts of my pom.xml:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>1.5</version>
    <executions>
        <execution>
            <id>add-test-source</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-test-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>src/at/java</source>
                 </sources>
            </configuration>
    </execution>
</executions>
</plugin>

<plugin>
    <groupId>org.jbehave</groupId>
    <artifactId>jbehave-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>run-stories-as-embeddables</id>
            <phase>integration-test</phase>
            <configuration>
<includes>
                     <include>**/*.java</include>
                </includes>
            </configuration>
           <goals>
               <goal>run-stories-as-embeddables</goal>
          </goals>
       </execution>
    </executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
    <version>2.11</version>
    <executions>
        <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
                <goal>test</goal>
           </goals>
           <configuration>
               <skip>false</skip>
              <includes>
                   <include>**/*.java</include>
               </includes>
           </configuration>
        </execution>
    </executions>
</plugin>

Thanks

James


Reply via email to