Last weekend, I did a combined release of the latest bugfixes in PMD 5.3.5 and a fresh release of PMD 5.4.0. This new major release combines some improvements and several pull requests from the community.

There is a big changelog entry for 5.4.0. Most notably, PMD 5.4.0 increased the runtime requirements to have at least a Java 7 runtime. This makes sense, as Java 6 is long time EOL - actually, the last official update for Java 6 was in February 2013 (!!). Actually, Java 7 is also already EOL. While PMD uses now Java 7 to compile, it doesn’t use yet source code features of java 7 (like try with resources, diamond operator, …) - that’s on the roadmap for later. BTW The switch to java 7 doesn’t affect the capabilities of PMD in anyway: It still can analyze every java version from 1.3 to 1.8.

Another improvement is: PMD uses now travis-ci to CI builds. All pushes and pull requests will be verified, and you get a nice badge: Build Status

Roadmap and source code branches

Now we have as next versions potentially three different ones:

  • 5.3.6: branch pmd/5.3.x
  • 5.4.1: branch pmd/5.4.x
  • 5.5.0: branch master

I plan to provide bugfix releases for both 5.3.x and 5.4.x, while new (experimental) features will go into the master branch.

Surely, bugfixes, that should go into both branches, need to be based off on the latest common commit. I’m try to avoid cherry picking and use bugfix branches instead that I can merge into all three branches. This has the benefit, that the bugfix has only one commit (or one set of commits) and no duplicates. And if you browse the git history, you can already see on which branches this commit is and you know immediately for which versions is has been fixed.

As mentioned on the linked blog post, you can find this latest common commit with git merge-base. In order create a bugfix branch that you want to merge into all three branches later on, create it like this:

git checkout -b bugfix-xyz \
  $(git merge-base --octopus origin/master origin/pmd/5.3.x origin/pmd/5.4.x)

For any Java 7 code style improvements, I want to have it only in the 5.4.x and master branches, so:

git checkout -b feature-java7 \
  $(git merge-base --octopus origin/master origin/pmd/5.4.x)

Other topics on the road map are:

  • Improve pmd-eclipse-plugin
  • Improve documentation with regards to:
    • Test framework - how to create unit tests for rules
    • Extend PMD with own/custom rules - provide a ready to start template project, where you can start hacking your own rules. And this is independent of the PMD repository.
    • How to configure PMD
    • How to contribute. Like a contrbutor’s guide and a developer’s guide.
  • A new GUI - see also the discussion and the mailing list
  • Of course, bug fixes

Maven PMD Plugin

Until the maven pmd plugin is updated to fetch PMD 5.4.0, you can enable it on your own. All you need to do is, to override the plugin’s dependencies, like that:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.5</version>
                <dependencies>
                    <dependency>
                        <groupId>net.sourceforge.pmd</groupId>
                        <artifactId>pmd-core</artifactId>
                        <version>5.4.0</version>
                    </dependency>
                    <dependency>
                        <groupId>net.sourceforge.pmd</groupId>
                        <artifactId>pmd-java</artifactId>
                        <version>5.4.0</version>
                    </dependency>
                </dependencies>
            </plugin>

That’s how you can take advantage of the bug fixes already now.