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

Report mojos should check canGenerateReport() when called directly

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.3
    • 2.0.8
    • Sites & Reporting
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: