Movatterモバイル変換


[0]ホーム

URL:


 
» PMD Java API Edit on GitHub

PMD Java API

Table of Contents

The easiest way to run PMD is to just use a build plugin in your favorite build toollikeApache Ant,Apache Maven orGradle.

There are also many integrations for IDEs available, seeTools.

If you have your own build tool or want to integrate PMD in a different way, you can call PMD programmatically,as described here.

Dependencies

You’ll need to add the dependency to the language, you want to analyze. For Java, it will benet.sourceforge.pmd:pmd-java. If you use Maven, you can add a new (compile time) dependency like this:

<dependency><groupId>net.sourceforge.pmd</groupId><artifactId>pmd-java</artifactId><version>${pmdVersion}</version></dependency>

Note: You’ll need to select a specific version. This is done in the example via the propertypmdVersion.

This will transitively pull in the artifactpmd-core which contains the API.

Running PMD programmatically

The programmatic API for PMD is centered aroundPmdAnalysis, please see the javadocs for usage information.

Running CPD programmatically

The programmatic API for CPD is centered aroundCpdAnalysis, please see the javadocs for usage information.


This documentation is written in markdown.
If there is something missing or can be improved, edit this page on github and create a PR: Edit on GitHub

©2025 PMD Open Source Project. All rights reserved.
Page last updated: August 2023 (7.0.0)
Site last generated: Jun 27, 2025

PMD                logo


[8]ページ先頭

©2009-2025 Movatter.jp