We have a set of example plugins that you can use as a guide. Make sure you are using the appropriate branch for the version of Nexus you are developing against. The source code of all our distributed OSS plugins are available in the nexus-public git repo ( older branches of code found in nexus-oss git repo ).
We have special instructions for customers wanting to write a Staging Suite plugin or staging rule.
If you plan to develop a plugin using Nexus Professional features, make sure you have configured access to our Nexus Private Development repository.
Of course, you'll also want to test your plugin - check out our nexus testsuite guide.
Our book also has a Plugin Development chapter.