Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.4.5
-
Fix Version/s: 3.5
-
Component/s: Ant Tasks, Maven Plugin
-
Labels:None
-
Number of attachments :
Description
The Maven plug-in does not configure a code location on the embedder's storyReportBuilder, therefore the story reporter will attempt to find story stats files in a directory relative to the current directory, and write the reports relative to the current directory as well.
Example project structure:
/ /app /app-stories
If the app-stories project uses the JUnit integration to run stories, its output files will correctly be written to /app-stories/target/jbehave.
A generate-stories-view mojo configured in app-stories/pom.xml will not find those output files and write the reports.html to the incorrect directory, unless the Maven build is started in the app-stories module directory.
For instance, in the root directory:
mvn verify -pl :app-stories
would search for story output files in /target/jbehave, not find anything, and write an empty reports.html to /target/jbehave/views.
Note that the unpack-view-resources mojo in the same pom.xml will work correctly, because it uses a different (and correct) way of configuring the output directory.
Suggestion:
Use the project.build.outputDirectory or project.build.testOutputDirectory properties to derive the story reporter builder code location from within the mojo.
Patch suggested via Github: https://github.com/jbehave/jbehave-core/pull/18