Target JDK

There is a configuration element in the PMD plugin that lets you set which target JDK your Java code will be compiled for. Often you want this to be in sync with the configuration for maven-compiler-plugin. The best practice for this is to set up the wellknown property maven.compiler.target and the rest will work automatically. Alternatively, you can set it manually:

<project>
  ...
  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.5</version>
        <configuration>
          <targetJdk>1.6</targetJdk>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  ...
</project>