Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Maven PMD Plugin Print Errors to Console

How can I make the Maven PMD Plugin print the PMD errors that it finds to the console during a "mvn install"? Right now, the output is going into a pmd error file in the target dir. It looks like old version of the plugin supported the variable "maven.pmd.console", but the new one doesn't seem to.

New PMD plugin: http://maven.apache.org/plugins/maven-pmd-plugin/

Old PMD plugin variables: http://maven.apache.org/maven-1.x/plugins/pmd/properties.html

like image 459
HappyCoder86 Avatar asked Aug 22 '13 21:08

HappyCoder86


1 Answers

Just like khmarbaise said, the below configuration worked:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>${plugin.maven.pmd.version}</version>
        <configuration>
           <minimumTokens>100</minimumTokens>
           <targetJdk>${jdk.version}</targetJdk>
           <printFailingErrors>true</printFailingErrors>
           <rulesets>
              <ruleset>example_pmd.xml</ruleset>
           </rulesets>
        </configuration>
        <dependencies>
           <dependency>
              <groupId>com.example</groupId>
              <artifactId>example</artifactId>
              <version>${example.version}</version>
           </dependency>
        </dependencies>
     </plugin>
like image 150
HappyCoder86 Avatar answered Oct 06 '22 09:10

HappyCoder86