##### Overview

- Download PMD 5.0.5
- What's new in PMD 5.0.5
- PMD in the news
- PMD-related products and books
- Best practices
- Future directions
- Similar projects
- Credits
- License
- What does 'PMD' mean?

##### Usage

- Installation
- Command line usage
- Ant task usage
- Maven plugin usage
- Mvn plugin usage
- IDE plugin usage
- Suppressing warnings
- Finding duplicated code
- JSP support

##### Customizing PMD

- Compiling PMD
- How to write a rule
- Writing XPath rules
- How to make a rule set
- How it works
- Rule guidelines
- PMD developers information
- PMD Release Process

##### For example

- Run PMD on a Sourceforge project

##### Misc.

- XPath tutorial (Gregorian)

##### Rule Sets

- ecmascript
  - Basic Ecmascript
  - Braces
  - Unnecessary
- java
  - Android
  - Basic
  - Braces
  - Clone Implementation
  - Code Size
  - Comments
  - Controversial
  - Coupling
  - Design
  - Empty Code
  - Finalizer
  - Import Statements
  - J2EE
  - JavaBeans
  - JUnit
  - Jakarta Commons Logging
  - Java Logging
  - Migration
  - Naming
  - Optimization
  - Strict Exceptions
  - String and StringBuffer
  - Security Code Guidelines
  - Type Resolution
  - Unnecessary
  - Unused Code
- jsp
  - Basic JSF
  - Basic JSP
- xml
  - Basic XML
- xsl
  - XPath in XSL

##### Project Documentation

- Project Information
- Project Reports

## PMD Release Process Walkthrough

This page describes the current status of the release process.

### Preparations

Make sure code is up to date and everything is committed and pushed with git:

    $ mvn clean
    $ git pull
    $ git status

Ensure all the new rules are listed in a src/main/resources/rulesets/releases/<version>.xml file.

Update the "download" and "what's new" link in site.pre.xml.

Update version/release info in etc/changelog.txt.

    $ mvn verify post-site    #(order of targets DOES matter)

Unzip and test manually (just to be on the safe side of the road):

    ./bin/run.sh pmd ~/tmp/Test.java xml java-unusedcode
    ./bin/run.sh pmd ~/tmp/Test.java html rulesets/java/unusedcode.xml

Check in all (version) changes to branch master:

    $ git commit -a -m "pmd: Prepare pmd release <version>"

### Release Branch

Let maven create a release branch (note - this is of course not needed if you are already on a release/maintenance branch). Maven will automatically increase the version in branch master. In case you create a alpha/preview release and you want to stay with the current version in master, use these additional properties: -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false

    $ mvn release:branch -DbranchName=pmd/<version>.x

Note: The property pushChanges is set to false, so that we can manually push all changes done during the release at the end, when we are sure, that everything is fine.

### Create a release

Now checkout the created branch.

    $ git checkout pmd/<version>.x

Now let maven create a release tag.

    $ mvn release:clean
    $ mvn release:prepare

Note: For the tag/label name we currently use this naming pattern: pmd_releases/<major-version>.<minor-version>.<micro-version>

The next command will checkout PMD from the tag just created and will build and deploy it to sonatype OSS repositories:

    $ mvn release:perform

#### Push your local changes

If everything is fine, you can push your local changes.

    $ git push origin master
    $ git push origin pmd/<version>.x
    $ git push origin tag pmd_releases/<version>

#### Rollback

Note:

If you see a bug and fix it, you can rollback the release (see http://maven.apache.org/plugins/maven-release-plugin/examples/rollback-release.html):

    $ mvn release:rollback

You probably need to delete the release tag manually using the following command (and then start again with release:clean release:prepare):

    $ git tag -d pmd_releases/<version>

### Publish artifacts

Finally, in order to publish the release to Maven central, you need to release PMD via Sonatype Nexus:

- Login to https://oss.sonatype.org/
- Go to Staging Repositories page
- Select a staging repository
- Click the close button
- Now you can download the artifacts again and verify they are working.
- Once you are sure they are working, click "Release" and the artifacts are eventually available through maven central.

Publish the release on sourceforge:

- Go to Files, to folder "pmd", create a new subfolder for the new version
- Add the pmd-<version>-bin.zip file
- Add the pmd-<version>-src.zip file
- Add the file etc/changelog.txt as ReadMe.txt file

Upload command below will create and upload the maven artifacts to sourceforge. Login info for 'pmd-repo' and 'pmd-site' must be defined in ~/.m2/settings.xml (see the file available in maven-plugin-pmd-build/config/m2.settings.xml):

    $ ssh your_sf_login,pmd@shell.sourceforge.net create
    ...
    $ mvn deploy -Psf-release

(In order to be able to upload the artifacts and the site to sourceforge, you need to have a interactive shell opened before)

### Site Upload

Upload the site:

    $ mvn site-deploy -Psf-release

Shutdown the sourceforge shell:

    $ ssh your_sf_login@shell.sourceforge.net "shutdown"

### Social side of release

1. Submit news to SF on the PMD Project News page.
2. Go to freecode (former freshmeat.net)
3. Facebook, Google+, Twitter, LinkedIn and Xing (add whatever you feel is missing here...)