Tag Archives: PMD

checkstyle and pmd

first of all i think checkstyle and pmd are 2 really cool tools, which can improve java source code… but its kinda hard to fulfill them…

or lets say… an old project is really hard… mainly it should be easy, but due to svn and history reasons, an automated refactoring is crap!

but lets do just the important and simple things:

<plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-checkstyle-plugin</artifactId>
       <configuration>
              <configLocation>[remote file]</configLocation>
       </configuration>
</plugin>
<plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-pmd-plugin</artifactId>
       <version>2.5</version>
 </plugin>

run checkstyle

mvn checkstyle:check

run pmd

mvn pmd:pmd

and with hudson is really cool 🙂

eclipse import cleanup

import other classes to a class is mainly a pain… a lot of imports are normally needed, a few are duplicated, and this is crap… based on PMD… ok it might be right, but in my point of view the compiler should clean the import… not that i have ever thought about it, but currently i do… 😛

and eclipse can clean the imports easyly….

Crtl+Shift+o

bah…