Package net.sourceforge.pmd
Class PMD
- java.lang.Object
-
- net.sourceforge.pmd.PMD
-
@Deprecated public final class PMD extends Object
Deprecated.This class is to be removed in PMD 7 in favor of a unified PmdCli entry point.PmdAnalysis
should be used for non-CLI use-cases.Entry point for PMD's CLI. UserunPmd(PMDConfiguration)
orrunPmd(String...)
to mimic a CLI run. This class is not a supported programmatic API anymore, usePmdAnalysis
for fine control over the PMD integration and execution.Warning: This class is not intended to be instantiated or subclassed. It will be made final in PMD7.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PMD.StatusCode
Deprecated.This class is to be removed in PMD 7 in favor of a unified PmdCli entry point.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
main(String[] args)
Deprecated.Entry to invoke PMD as command line tool.static PMD.StatusCode
runPmd(String... args)
Deprecated.Parses the command line arguments and executes PMD.static PMD.StatusCode
runPmd(PMDConfiguration configuration)
Deprecated.Execute PMD from a configuration.
-
-
-
Method Detail
-
main
public static void main(String[] args)
Deprecated.Entry to invoke PMD as command line tool. Note that this will invokeSystem.exit(int)
.- Parameters:
args
- command line arguments
-
runPmd
public static PMD.StatusCode runPmd(String... args)
Deprecated.Parses the command line arguments and executes PMD. Returns the status code without exiting the VM. Note that the arguments parsing may itself fail and produce aPMD.StatusCode.ERROR
. This will print the error message to standard error.- Parameters:
args
- command line arguments- Returns:
- the status code. Note that
PMDConfiguration.isFailOnViolation()
(flag--failOnViolation
) may turn anPMD.StatusCode.OK
into aPMD.StatusCode.VIOLATIONS_FOUND
.
-
runPmd
public static PMD.StatusCode runPmd(PMDConfiguration configuration)
Deprecated.Execute PMD from a configuration. Returns the status code without exiting the VM. This is the main entry point to run a full PMD run with a manually created configuration.- Parameters:
configuration
- Configuration to run- Returns:
- the status code. Note that
PMDConfiguration.isFailOnViolation()
(flag--failOnViolation
) may turn anPMD.StatusCode.OK
into aPMD.StatusCode.VIOLATIONS_FOUND
.
-
-