Thx Seth for the piece of advice.

Unfortunately I already did that.

I configured the jbehave-maven-plugin in the root <dependencyManagement>
section of the pom.xml.

I defined a profile on the non root project, declaring the
jbehave-maven-plugin in the build section of that profile.

When I invoke a build with that profile the plugin executes but finds only 2
stories ie the default ones : BeforeStories and AfterStories.

2011/10/23 Seth <[email protected]>

> Right now it sounds like the only execution of jbehave is happening at the
> parent level so the relative path is always for the parent.  Moving the
> execution to the child module via a profile will give maven the correct
> "working directory", you can fix it with profile inheritence and plugin
> management.
> In your parent pom put the jbehave plugin in a profile inside a plugin
> management stanza. You can do all the config there. In your child module pom
> also define a profile with the same name as the one you configured in the
> parent, you only need to specify the group id and artifact id in the plugin
> section of the profile (it will inherit the config set in the parent)
> In this way the relative paths will be correct when each module runs and
> only those modules that have the jbehave profile will execute the jbehave
> tests, this is important if not all the modules require the jbehave
> execution.
>
> Seth
>
> On Oct 23, 2011, at 9:54 AM, louis gueye <[email protected]> wrote:
>
> > Hi all,
> >
> > I've come around a strange behaviour. I'm on that issue since 5 days. Now
> I've understood the problem.
> >
> > When I run jebahave-maven-plugin on a single module project the
> InjectableEmbedder can find my stories.
> >
> > When I run jebahave-maven-plugin on a muti module project, from the
> project defining stories the InjectableEmbedder can find my stories.
> >
> > When I run jebahave-maven-plugin on a muti module project, from the root
> project the InjectableEmbedder can't find my stories. I guess it's related
> to how I look for the stories :
> >
> >     /**
> >      * @see org.jbehave.core.Embeddable#run()
> >      */
> >     @Test
> >     @Override
> >     public void run() throws Throwable {
> >         injectedEmbedder().runStoriesAsPaths(storyPaths());
> >     }
> >
> >     protected List<String> storyPaths() {
> >         return new StoryFinder().findPaths("src/test/resources",
> Arrays.asList("**/*.story"), null);
> >     }
> >
> > my dirs are organized this way :
> >
> >  - root
> >    + acceptance-tests
> >    + server
> >    + webapp
> >
> > When I run mvn clean install -Pjbehave from root nothing happens because
> root project, which has pom packaging doesn't have any src/test/resources
> dir.
> > When I run mvn clean install -Pjbehave from acceptance-tests it runs the
> sories.
> >
> > My build always runs on the root dir. I don't want to merge all modules
> just because of jbehave. Any idea how I could keep the best of both worlds ?
> >
> > Thx
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to