The java custom-rules plugin template moved to a better place!
To learn how to write custom rules, please refer to the documentation embedded directly in the Open Source SonarSource Java Analyzer Repository, available here: SonarSource/SonarJava.
The Java Analyzer repository also contains an embedded tutorial, as well as a template maven project to start writing custom rules fast. This template will be up-to-date with the latest releases of the Java Analyzer.