Maven – PMD example

In this article, we will show you how to use Maven PMD Plugin to analyze the Java code. P.S PMD requires Java 1.7 1. Maven PMD Plugin Define the maven-pmd-plugin in the reporting tag, so that mvn site will generate the PMD report. pom.xml <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>3.11.0</version> </plugin> </plugins> </reporting> 2. Java …

Read more

PMD error – Can’t use JDK 1.5 for loop syntax when running in JDK 1.4 mode!

When i integrate Hudson and PMD together to run the PMD static code analysis process in my web project. I hit the following error message. By the way , i’m using Maven 2 to mange my web project. Caused by: net.sourceforge.pmd.ast.ParseException: Can’t use JDK 1.5 for loop syntax when running in JDK 1.4 mode! at …

Read more