An example of a Gradle plugin implemented in Java.
It is described on my blog
The plugin project describes the plugin implementation and the consumer project is an example on how the plugin can be used.
This example was build and tested with Gradle 2.2.1.