Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-2188

Report mojos should check canGenerateReport() when called directly

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: 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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: