Uploaded image for project: 'Maven PMD Plugin'
  1. Maven PMD Plugin
  2. MPMD-236

Honor pmd:pmd/cpd config in pmd:check/cpd-check goals

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • CPD, PMD
    • None

    Description

      In the PMD plugin, it seems that configuration for the pmd:pmd and cpd:cpd goals that are executed transitively by way of the pmd:check and cpd:cpd-check goals are not honored. For example, here's the specific issue I am seeing.
      Let's say I need to run pmd on tests and want to fail the build. Intuitively you'd think I could do pmd:check and set includeTests=true. However, this doesn't work because pmd:check doesn't support includeTests. I am not interested in generating the report, and per the site documentation for the plugin, pmd:check generates the report anyway. However, it doesn't support the configuration associated with pmd:pmd.

      What I would like to do is this (which doesn't work):

                          <execution>
                              <id>pmd-check</id>
                              <goals>
                                  <goal>check</goal>
                              </goals>
                              <phase>verify</phase>
                              <configuration>
                                  <includeTests>${pmd.includeTests}</includeTests>
                              </configuration>
                          </execution>

      What I have is this:

                          <execution>
                              <id>pmd-check</id>
                              <goals>
                                  <goal>check</goal>
                                  <goal>pmd</goal> <!-- Is this needed? -->
                              </goals>
                              <phase>verify</phase>
                              <configuration>
                                  <includeTests>${pmd.includeTests}</includeTests>
                              </configuration>
                          </execution>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              AlexRentz Alex Rentz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: