Maven PMD Plugin
  1. Maven PMD Plugin
  2. MPMD-99

Report doesn't reflect the real PMD version used

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: PMD
    • Labels:
      None

      Description

      If the PMD dependency is overloaded to a new version of PMD (by having a dependency section attached to the plugin definition in the pom.xml), PMD won't show the real PMD version used.

      This is because, the version shown following the "The following document contains the results of" on the html report is taken from PMD.VERSION which is inlined by the compiler at compilation and so is always 4.2.2.

      The solution is to use the one in the pmd.xml header (<pmd version="4.2.5" timestamp="2009-06-04T18:29:18.945">) which is always right.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        330d 4h 20m 1 Hervé Boutemy 30/Apr/10 17:43
        Mark Thomas made changes -
        Workflow jira [ 12960522 ] Default workflow, editable Closed status [ 12997742 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 00:25:00 UTC 2015 [ 1428279900867 ]
        Mark Thomas made changes -
        Workflow jira [ 12722840 ] Default workflow, editable Closed status [ 12756510 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 12:01:39 UTC 2015 [ 1428235299271 ]
        Hervé Boutemy made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 2.5 [ 14419 ]
        Resolution Fixed [ 1 ]
        Assignee Herve Boutemy [ hboutemy ]
        Hide
        Hervé Boutemy added a comment -

        code committed in r939832.
        Thank you for the patch

        Show
        Hervé Boutemy added a comment - code committed in r939832. Thank you for the patch
        Henri Tremblay made changes -
        Field Original Value New Value
        Attachment PmdReportListener.java [ 42644 ]
        Hide
        Henri Tremblay added a comment -

        I little bit dull but working solution is to retrieve the version by reflection. This is what I'm doing in the file. The same thing applies to CpdReportGenerator (although I didn't provided here).

        It works perfectly and I can't see how to get the version otherwise.

        Show
        Henri Tremblay added a comment - I little bit dull but working solution is to retrieve the version by reflection. This is what I'm doing in the file. The same thing applies to CpdReportGenerator (although I didn't provided here). It works perfectly and I can't see how to get the version otherwise.
        Henri Tremblay created issue -

          People

          • Assignee:
            Hervé Boutemy
            Reporter:
            Henri Tremblay
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development