JBehave
  1. JBehave
  2. JBEHAVE-586

StoryReporterBuilder code location should be settable from the output directory by Ant tasks and Maven goals

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor 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 :
      0

      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.

        Activity

        Hide
        Dennis Homann added a comment -
        Show
        Dennis Homann added a comment - Patch suggested via Github: https://github.com/jbehave/jbehave-core/pull/18
        Mauro Talevi made changes -
        Field Original Value New Value
        Fix Version/s 3.5 [ 17393 ]
        Hide
        Mauro Talevi added a comment -

        Pulled patch, with thanks.

        Show
        Mauro Talevi added a comment - Pulled patch, with thanks.
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mauro Talevi made changes -
        Summary Reporting mojos do not resolve output directory relative to project directory, but to relative to current directory StoryReporterBuilder code location should be settable from the output directory by Ant tasks and Maven goals
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Component/s Ant Tasks [ 11081 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Dennis Homann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: