bld extension to perform static code analysis with PMD https://github.com/rife2/bld-pmd
Find a file
2025-03-18 23:39:56 -07:00
.github/workflows JDK 24 2025-03-18 23:39:56 -07:00
.idea Bump bld to version 2.2.1 2025-02-24 23:24:45 -08:00
.vscode Bump bld to version 2.2.1 2025-02-24 23:24:45 -08:00
config Bumped PMD to version 7.7.0 2024-10-25 12:09:44 -07:00
lib/bld Bump bld to version 2.2.1 2025-02-24 23:24:45 -08:00
src Bump JUnit to version 5.12.1 2025-03-18 23:39:47 -07:00
.gitignore Added publishing info 2023-04-15 09:06:16 -07:00
bld Initial commit 2023-04-14 06:02:38 -07:00
bld.bat Initial commit 2023-04-14 06:02:38 -07:00
LICENSE.txt Initial commit 2023-04-14 06:02:38 -07:00
README.md Add generic installation instruction 2025-03-18 12:29:21 -07:00

bld Extension to Perform Static Code Analysis with PMD

License Java bld Release Snapshot GitHub CI

To install the latest version, add the following to the lib/bld/bld-wrapper.properties file:

bld.extension-pmd=com.uwyn.rife2:bld-pmd

For more information, please refer to the extensions documentation.

Check Source with PMD

To check all source Codecode using the Java Quickstart configuration, add the following to your build file:

@BuildCommand(summary = "Checks source code with PMD")
public void pmd() throws Exception {
    new PmdOperation()
        .fromProject(this)
        .execute();
}
./bld pmd test

To check the main source directory using a custom ruleset, Java Error Prone configuration, and failing on any violation.

@BuildCommand(value = "pmd-main", summary = "Checks main source code with PMD")
public void pmdMain() throws Exception {
    new PmdOperation()
            .fromProject(this)
            .failOnViolation(true)
            .inputPaths(srcMainDirectory())
            .ruleSets("config/pmd.xml", "category/java/errorprone.xml")
            .execute();
}
./bld compile pmd-main

Please check the PmdOperation documentation for all available configuration options.