Hi all,

On http://jbehave.org/software/plugins/maven/ page, there is this snippet:

> The configuration of the plugin would look something like:
>
> where the include/exclude patterns are intended relative to the classpath.
> Note that jBehave does not mandate any particular structure. The only
> requirement is that only classes that extend the jBehave
> org.jbehave.scenario.Scenario class are included.
>
I am trying to create a Maven project to follow Ryan Greenhall's tutorial
(BTW, why is this tutorial not linked on the project page?). Right now, I
have a scenario with all steps pending. I got this to run from within my IDE
(Eclipse), but I would like to run it from Maven too.

JBehave's maven plugin seems to have elaborate configuration options. Also,
the example projects at https://svn.codehaus.org/jbehave/trunk/examples/ are
not easy to follow because it, with a scenario subproject to run JBehave
etc, looks different from typical maven projects.

I tried to configure the plugin with a blind stab, hoping for some
intelligents defaults to help me out:

            <plugin>
                <groupId>org.jbehave</groupId>
                <artifactId>jbehave-maven-plugin</artifactId>
                <version>2.0.1</version>
                <executions>
                    <execution>
                        <id>run-scenarios-found</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>run-scenarios</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

When my scenario class is in src/main/java, jbehave complains :

> [INFO] [compiler:compile]
> [INFO] Compiling 1 source file to
> /Users/binil/temp/jbehave-try/target/classes
>
...

> [INFO] Failed to instantiate scenarios [binil.HeyHeyMyMy]
> Embedded error: The Scenario 'binil.HeyHeyMyMy' could not be instantiated
> with classpath elements: [/Users/binil/temp/jbehave-try/target/classes/,
> jbehave-core-2.0.1.jar, junit-4.4.jar]
> binil.HeyHeyMyMy.<init>(java.lang.ClassLoader)
>
When I move my scenario class to src/test/java, I get a:

> [INFO] [jbehave:run-scenarios {execution: run-scenarios-found}]
> [INFO] No scenarios to run.
>
message.

(In both cases the hey_hey_my_my text file is at src/main/resources).

Please let me know how I should go about configuring the plugin.

Thanks,
Binil

Reply via email to