This page describes the current status of the release process.
Make sure code is up to date and everything is committed and pushed with git:
$ mvn clean $ git pull $ git status
Checklist for release preparation:
$ mvn clean install
Unzip and test manually (just to be on the safe side of the road):
cd pmd-dist/target; unzip pmd-bin-<version>.zip; cd pmd-bin-<version> ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f xml -R rulesets/java/unusedcode.xml ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f xml -R java-unusedcode ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f html -R rulesets/java/unusedcode.xml cd ..; cd ../..
Check in all (version) changes to branch master:
$ git commit -a -m "Prepare pmd release <version>"
Let’s have maven create a release branch for us (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.
$ mvn release:branch -DbranchName=pmd/<version>.x
In case you create a alpha/preview release and you want to stay with the current version in master, use these additional properties:
$ mvn -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false ...
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.
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
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>
Note: If you see a bug and fix it, you can rollback the release (see the maven release plugin documentation):
$ 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>
Finally, in order to publish the release to Maven central, you need to release PMD via Sonatype Nexus:
You can reuse the cleanly checked out local repository from maven-release-plugin.
$ cd target/checkout/ $ mvn site site:stage
Before you upload the zip files, unzip and test once (just to be on the safe side of the road):
$ cd pmd-dist/target; unzip pmd-bin-<version>.zip; cd pmd-bin-<version> $ ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f xml -R rulesets/java/unusedcode.xml $ ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f xml -R java-unusedcode $ ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f html -R rulesets/java/unusedcode.xml $ cd ..; cd ../..
While the site will be deployed to github, it’s still usefull, to have it downloadable at once:
$ cd target $ mv staging pmd-doc-<version> $ zip -r pmd-doc-<version>.zip pmd-doc-<version>/ $ cd ..
Add the site to the pmd.github.io repo:
$ rsync -avhP target/pmd-doc-<version>/ ../../../pmd.github.io/pmd-<version>/ $ (cd ../../../pmd.github.io; git add pmd-<version>; git commit -m "Added pmd-<version>")
Upload the zip-files to sourceforge’s file section:
$ rsync -avhP pmd-dist/target/pmd-*-<version>.zip target/pmd-doc-<version>.zip your_sf_login@web.sourceforge.net:/home/frs/project/pmd/pmd/<version>/ $ rsync -avhP src/site/markdown/overview/changelog.md your_sf_login@web.sourceforge.net:/home/frs/project/pmd/pmd/<version>/ReadMe.md
Verify the MD5 sums on Files and locally:
$ md5sum pmd-dist/target/pmd-*-<version>.zip target/pmd-doc-<version>.zip
Go to Files, to folder “pmd/<version>”, and make the new binary pmd zip file the default download for all platforms.
In case of releasing from master:
$ git push origin master; git push origin tag pmd_releases/<version>
In case of releasing from a release branch:
$ git push origin pmd/<version>.x; git push origin tag pmd_releases/<version>
Go to https://github.com/pmd/pmd/releases
Submit news to SF on the PMD Project News page. You can use the following template:
PMD <version> released * minor version with lots of bug fixes * Changelog: https://pmd.github.io/pmd-<version>/overview/changelog.html * Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F<version> * Fixed Bugs: https://sourceforge.net/p/pmd/bugs/milestone/PMD-<version>/ * Documentation: https://pmd.github.io/pmd-<version>/
Under https://sourceforge.net/p/pmd/bugs/milestones close the milestone “PMD-<version>” and create a new milestone for the next version (PMD-<version+1>).
Update version/release info in src/site/markdown/overview/changelog.md. Use the following template:
# Changelog ## ????? - ${DEVELOPMENT_VERSION} **New Supported Languages:** **Feature Request and Improvements:** **New/Modified/Deprecated Rules:** **Pull Requests:** **Bugfixes:** **API Changes:**
Update pmd-java8/pom.xml - the version is probably wrong. Set it to the parent’s=next development version.
Commit and push
$ git commit -m "Prepare next development version" $ git push origin master