The PMD (a static analysis tool) integration for the Bazel build system.
bazel_dep(name = "rules_pmd", version = "...")Please refer to GitHub releases for the available versions.
Once declared in the MODULE.bazel file, the rule can be loaded in the BUILD file.
load("@rules_pmd//pmd:defs.bzl", "pmd_test")
pmd_test(
name = "pmd_analysis_test",
srcs = glob(["src/main/java/**/*.java"]),
)Change the MODULE.bazel file:
pmd = use_extension("//pmd:extensions.bzl", "pmd")
pmd.pmd_version(
version = "x.x.x",
sha256 = "x.x.x.sha256",
)
use_repo(pmd, "net_sourceforge_pmd")See available attributes.
$ bazel build //YOUR_PACKAGE:pmd_analysis