30 May 2025
The PMD team is pleased to announce PMD 7.14.0.
This is a minor release.
In the PMD CLI, the --threads
(-t
) option can now accept a thread
count given relative to the number of cores of the machine. For instance,
it is now possible to write -t 1C
to spawn one thread per core, or -t 0.5C
to spawn one thread for every other core.
The thread count option now defaults to 1C
, meaning parallel execution
is used by default. You can disable this by using -t 1
.
This new Java rule UnnecessaryWarningSuppression
reports unused suppression
annotations and comments. Violations of this rule cannot be suppressed.
How to use it? Just include it in your ruleset:
<rule ref="category/java/bestpractices.xml/UnnecessaryWarningSuppression" />
Note: This rule is currently experimental. It is available for now only for Java.
The rule for now only reports annotations specific to PMD, like @SuppressWarnings("PMD")
.
In the future we might be able to check for other common ones like @SuppressWarnings("unchecked")
or "fallthrough"
.
Since violations of this rule cannot be suppressed, we opted here on the side of false-negatives and
donât report every unused case yet.
However, suppressing specific PMD rules is working as expected.
Weâve now migrated to Central Publisher Portal. Snapshots of PMD are still available, however the repository URL changed. To consume these with maven, you can use the following snippet:
<repositories>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
Releases of PMD are available on Maven Central as before without change.
When executing PMD or CPD, the same parameters are now understood for selecting which files should be analyzed. See File collection options for a list of common, shared parameters that are valid for both commands.
--report-file
(-r) and --exclude-file-list
.--exclude
and --non-recursive
.--ignore-list
in PMD is renamed to --exclude-file-list
.--ignore-list
has been deprecated. Use --exclude-file-list
instead.AstInfo#getSuppressionComments
: Use getAllSuppressionComments
or getSuppressionComment
.AstInfo#withSuppressMap
: Use withSuppressionComments
AbstractTokenManager#suppressMap
: Donât use this map directly anymore. Instead,
use getSuppressionComments
.AbstractTokenManager#getSuppressMap
: Use
getSuppressionComments
instead.ASTCompactConstructorDeclaration#getDeclarationNode
: This method just returns this
and isnât useful.JavaMetrics#NPATH
: Use NPATH_COMP
, which is available on more nodes,
and uses Long instead of BigInteger.