Saturday, April 17, 2010

maven pmd plugin and cpd

$ mvn jxr:jxr pmd:pmd pmd:cpd

configuration:
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <!-- to link to the output of jxr -->
          <linkXref>true</linkXref>
          <!-- if this is the root project -->
          <aggregate>true</aggregate>
          <!-- minimum token to detect duplicate -->
          <minimumTokens>100</minimumTokens>
          <targetJdk>1.5</targetJdk>
          <excludes>
            <exclude>**/*Bean.java</exclude>
          </excludes>
          <excludeRoots>
            <excludeRoot>the_source_dir_to_exclude</excludeRoot>
          </excludeRoots>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

No comments:

Post a Comment