GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.pmd-code.org — Gradle | PMD Source Code Analyzer
Release date: 28-December-2026
GradleTable of ContentsThe Gradle Build Tool provides a PMD Plugin that can be added to your build configuration. Technically it is based on the Ant Task. ExampleIn your Custom rulesetConfiguration of a custom ruleset looks like this: Note: The Fail the buildIf you want to fail the build for pmd violations, you need to set More configuration options are documented on PMD Extension. Upgrade PMD versionIf you want to use a newer PMD version than the default one provided with Gradle, you can do so
with the property Note For PMD 7, at least Gradle 8.6 is needed. See Support for PMD 7.0. Aux ClasspathGradle by default adds all project dependencies to the aux classpath. Since PMD 7.27.0, you’ll get a warning if the platform classes will be resolved by the running JVM. To avoid this, explicitly add the platform classpath of the correct Java version to PMD’s aux classpath. The example is using the toolchains feature of Gradle: See Providing the auxiliary classpath. Environment VariablesEnvironment variables are not automatically passed through to Gradle’s PMD Plugin. E.g. using any Language properties with Gradle is not straight forward, as PMD is called in an isolated worker process without any environment variables. The following snippets creates a subclass of Gradle’s PMD task in order to provide all PMD specific environment variables. This task needs to be registered and the default tasks “pmdMain” and “pmdTest” need to be disabled. With that configuration, you can call Gradle like that: Complete ExampleSee https://github.com/pmd/pmd-examples/tree/main/gradle/simple-project. ReferencesSource code for Gradle’s PMD Plugin is available here:
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |