Hi Brian,
can you provide us with a sample project (with pom.xml and the simplest
source possible) reproducing this issue?
Thanks
On 02/07/2012 15:51, Brian wrote:
Hello there
I've been trying to use jbehave on a project and I ran into some problems.
When running the maven goal, I got the following error:
[ERROR] Failed to execute goal
org.jbehave:jbehave-maven-plugin:3.6.7:run-stories-as-embeddables
(default-cli) on project springmvc-router: Execution default-cli
of goal
org.jbehave:jbehave-maven-plugin:3.6.7:run-stories-as-embeddables
failed: A required class was missing while executing
org.jbehave:jbehave-maven-plugin:3.6.7:run-stories-as-embeddables:
javax/servlet/http/HttpServletRequest
It looks like jbehave's Embedder classloader can't locate
the HttpServletRequest. This dependency is declared in my main POM
like this:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
If I ever change the scope to "compile", I get another error saying:
Caused by: java.lang.InstantiationException:
org.myproject.OneOfMyProjectClasses
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at
org.jbehave.core.embedder.EmbedderClassLoader.newInstance(EmbedderClassLoader.java:37)
... 24 more
Is there a typo/bug in my configuration?
I've browsed jbehave-maven-plugin (AbstractEmbedderMojo to be precise)
but couldn't anything on dependencies in provided scope. Should I open
an issue about that?
This is the maven config I've added to my POM:
<plugin>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-maven-plugin</artifactId>
<version>${jbehave.version}</version>
<executions>
<execution>
<id>run-stories-as-embeddables</id>
<phase>integration-test</phase>
<configuration>
<scope>test</scope>
<includes>
<include>**/MyStories.java</include>
</includes>
</configuration>
<goals>
<goal>run-stories-as-embeddables</goal>
</goals>
</execution>
</executions>
</plugin>
Thanks
-- Brian