GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • PMD Source Code Analyzer Project
  • Nav
  • Download
  • GitHub
  • Edit on GitHub

This view

  • Original page
  • New address

GeezerVison is showing docs.pmd-code.org — Building PMD General Info | PMD Source Code Analyzer

 
  • PMD 7.29.0
  • Release date: 30-October-2026
  • About
    • Home
    • Release notes
    • Getting help
    • Release policies
    • Support lifecycle
    • Security
  • User Documentation
    • Migration Guide for PMD 7
    • Installation and basic CLI usage
    • Making rulesets
    • Configuring rules
    • Best practices
    • Suppressing warnings
    • Incremental analysis
    • PMD CLI reference
    • PMD Report formats
    • 3rd party rulesets
    • Signed Releases
    • CPD reference
      • Copy-paste detection
      • CPD Report formats
    • Extending PMD
      • Introduction to writing rules
      • Your first rule
      • XPath rules
      • Java rules
      • Rule designer reference
      • Defining rule properties
      • Rule guidelines
      • Testing your rules
      • Creating (XML) dump of the AST
    • Tools / Integrations
      • Maven PMD Plugin
      • Gradle
      • Ant
      • PMD Java API
      • bld PMD Extension
      • CI integrations
      • IDE Plugins
      • Other Tools / Integrations
  • Rule Reference
    • Apex Rules
      • Index
      • Best Practices
      • Code Style
      • Design
      • Documentation
      • Error Prone
      • Performance
      • Security
    • HTML Rules
      • Index
      • Best Practices
    • Java Rules
      • Index
      • Best Practices
      • Code Style
      • Design
      • Documentation
      • Error Prone
      • Multithreading
      • Performance
      • Security
    • Java Server Pages Rules
      • Index
      • Best Practices
      • Code Style
      • Design
      • Error Prone
      • Security
    • JavaScript Rules
      • Index
      • Best Practices
      • Code Style
      • Error Prone
      • Performance
    • Kotlin Rules
      • Index
      • Best Practices
      • Error Prone
    • Maven POM Rules
      • Index
      • Error Prone
    • Modelica Rules
      • Index
      • Best Practices
    • PLSQL Rules
      • Index
      • Best Practices
      • Code Style
      • Design
      • Error Prone
    • Salesforce Visualforce Rules
      • Index
      • Security
    • Scala Rules
      • Index
    • Swift Rules
      • Index
      • Best Practices
      • Error Prone
    • Velocity Template Language (VTL) Rules
      • Index
      • Best Practices
      • Design
      • Error Prone
    • WSDL Rules
      • Index
    • XML Rules
      • Index
      • Best Practices
      • Error Prone
    • XSL Rules
      • Index
      • Code Style
      • Performance
  • Language-Specific Documentation
    • Overview
    • Language configuration
    • Apex
    • C/C++
    • C#
    • CSS
    • Coco
    • Dart
    • Fortran
    • Gherkin
    • Go
    • HTML
    • Java
    • JavaScript / TypeScript
    • JSP
    • Julia
    • Kotlin
    • Lua
    • Matlab
    • Modelica
    • Objective-C
    • Perl
    • PHP
    • PLSQL
    • Python
    • Ruby
    • Rust
    • Scala
    • Swift
    • T-SQL
    • Visualforce
    • Velocity Template Language (VTL)
    • XML and XML dialects
  • Developer Documentation
    • Contributing
      • Contributing
      • Developer resources
      • Newcomers' Guide
      • Writing documentation
    • Building PMD
      • General Info
      • Building PMD from source
      • Building PMD with IntelliJ IDEA
      • Building PMD with Eclipse IDE
      • Building PMD with VS Code IDE
      • Building PMD with Netbeans IDE
    • Roadmap
    • GitHub Actions Workflows
    • How PMD works
    • Logging
    • Pmdtester
    • Rule Deprecation Policy
    • Major contributions
      • Rule Guidelines
      • Adding a new dialect
      • Adding a new language (JavaCC)
      • Adding a new language (ANTLR)
      • Adding a new CPD language
    • Experimental features
      • List of experimental Features
  • Project documentation
    • Trivia about PMD
      • PMD in the press
      • Products & books related to PMD
      • Similar projects
      • What does 'PMD' mean?
    • Logo
    • FAQ
    • License
    • Credits
    • Old Release Notes
      • Release Notes PMD 7.x
      • Detailed Release Notes PMD 7.0.0
      • Release Notes PMD 6.x
      • Release Notes PMD 5.x
      • Release Notes PMD 4.x and earlier
    • Decisions
    • Project management
      • Infrastructure
      • Release process
      • Merging pull requests
      • Main Landing page

Building PMD General Info

Table of Contents

Before Development

  1. Ensure that Git and Java JDK >= 21 are installed.
    You can get a OpenJDK distribution from e.g. Adoptium.
    Note: While Java 21 is required for building, running PMD only requires Java 8.
  2. Fork the PMD repository on GitHub as explained in Fork a repository.
  3. Clone your forked repository to your computer:
    git clone [email protected]:your_user_name/pmd.git --depth=10 --no-tags
    
  4. Clone additionally the build-tools repository. It contains some settings, we’ll later use for configuring IDE:
    git clone [email protected]:pmd/build-tools.git
    
  5. To make sure your Maven environment is correctly setup, we’ll build pmd once:

    cd pmd
    ./mvnw clean verify -DskipTests -DskipITs
    

    This will help with Maven IDE integration. It may take some time, because it will download all dependencies, so go brew some coffee to get ready for the steps to come.

Note

This only clones the last ten commits and not the whole PMD repository. This makes it faster, as much less data needs to be downloaded. However, the history is incomplete. If you want to browse/annotate the source with the complete commit history locally, either clone the repo without the “depth” option or convert it to a “full” clone using git fetch --unshallow.

Reproducible Builds

Since PMD 6.24.0, we are creating Reproducible Builds. As we use Maven for building, the following limitations apply:

  • Generally give different results on Windows and Unix because of different newlines. (carriage return linefeed on Windows, linefeed on Unixes).

    We build our releases under Linux on GitHub Actions.

  • Generally depend on the major version of the JDK used to compile. (Even with source/target defined, each major JDK version changes the generated bytecode.).

    PMD 6.24.0 - 7.17.0 is built using OpenJDK 11. PMD 7.18.0 - 7.20.0 is built using OpenJDK 17. Since PMD 7.21.0, we build our releases using OpenJDK 21.

You can check the reproducible build status here: https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/net/sourceforge/pmd/README.md

How to build the documentation?

cd docs
bundle install # once
bundle exec jekyll build

You’ll find the built site in the directory _site/.

For more info, see README in docs directory.

How to test SNAPSHOT builds?

Every push to our main branch creates a new SNAPSHOT build. You can download the binary distribution from https://sourceforge.net/projects/pmd/files/pmd/. The binary distribution ZIP file behaves exactly the same as the real release: Just unzip it and execute PMD.

If you integrate PMD as a dependency in your own project, you can also reference the latest SNAPSHOT version. However, you also need to configure an additional Maven Repository, as the SNAPSHOTS are not published in Maven Central.

Use the Central Portal Snapshot repository url: https://central.sonatype.com/repository/maven-snapshots/. For Maven projects, this can be configured like:

<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>

Have a look at https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/net/sourceforge/pmd/pmd/ to see which SNAPSHOT versions are available. Note that old SNAPSHOT versions might be removed without prior notice.

See also https://central.sonatype.org/publish/publish-portal-snapshots/.

General Development Tips

  • Use an IDE, see one of the other guides
    • Building PMD with IntelliJ IDEA
    • Building PMD with Eclipse
    • Building PMD with Netbeans
    • Building PMD with VS Code
  • Contributing via GitHub and Pull Requests
  • Keep your fork up-to-date
    • You can do this either via GitHub’s Web UI
    • Or manually:
      git remote add upstream [email protected]:pmd/pmd.git
      git checkout main
      git pull --ff-only upstream main
      git push origin
      
    • See also Newcomers’ Guide
  • Always create a dev branch when you are going to commit something, so that you can easily create a PR later on.
  • Build a single module only: Always (re)building the complete PMD source takes quite a while. If you only change one module, you build and test just this single module to speed up development. Eg. if you changed a rule in pmd-apex only, you can just build this:
    ./mvnw verify -pl pmd-apex
    
  • If you are currently on a snapshot commit (as opposed to a release commit) you need snapshot modules as dependencies for the module you want to build. You can either build them yourself (line 1) or you can activate the snapshot repository (line 2) for your build:
    ./mvnw verify -pl pmd-apex -am
    ./mvnw verify -pl pmd-apex -Pcentral-portal-snapshots
    

    Caveats: We have some integration tests, that run only after all modules have been built. You could break these without noticing.
    Note: In our CI (via GitHub Actions) we always build the complete project.

Tags: devdocs
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.