Maven
  1. Maven
  2. MNG-2188

Report mojos should check canGenerateReport() when called directly

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.0.8
    • Component/s: Sites & Reporting
    • Labels:
      None
    • Flags:
      Patch

      Description

      There's a canGenerateReport() method in a ReportMojo. This method is called by the site phase to decide if the mojo should be called or not. This is cool. However the user can call directly the report mojo and in that case the canGenerateReport() method is not called automatically. Thus the solution for a plugin developer is to write:

      public void executeReport()
      {
          if (canGenerateReport() )
          { 
              [...]
          }
      }
      

      Which means that the canGenerateReport method is going to be called twice when mvn site is executed.

        Activity

        Vincent Massol created issue -
        Walco van Loon made changes -
        Field Original Value New Value
        Attachment AbstractMavenReport-canGenerateReport-check.patch [ 19966 ]
        John Casey made changes -
        Fix Version/s 2.0.5 [ 12294 ]
        kenneyw made changes -
        Fix Version/s 2.0.5 [ 12294 ]
        Fix Version/s 2.0.6 [ 13010 ]
        Jason van Zyl made changes -
        Fix Version/s 2.0.6 [ 13010 ]
        Fix Version/s 2.0.x [ 13141 ]
        Jason van Zyl made changes -
        Patch Submitted [Yes]
        Jason van Zyl made changes -
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]
        Brett Porter made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Assignee Vincent Massol [ vmassol ]
        Resolution Won't Fix [ 2 ]
        John Casey made changes -
        Assignee Vincent Massol [ vmassol ] John Casey [ jdcasey ]
        John Casey made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Closed [ 6 ]
        Fix Version/s 2.0.8 [ 13139 ]
        Fix Version/s 2.0.x [ 13141 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
        Mark Thomas made changes -
        Workflow jira [ 12712843 ] Default workflow, editable Closed status [ 12752725 ]
        Mark Thomas made changes -
        Flags Patch [ 10430 ]
        Patch Submitted Yes [ 10763 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
        Mark Thomas made changes -
        Workflow jira [ 12952137 ] Default workflow, editable Closed status [ 12989500 ]

          People

          • Assignee:
            John Casey
            Reporter:
            Vincent Massol
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development