Update plugin for Nexus 2.7.0 +various fixes

This pull request contains various fixes for possible NullPointerExceptions and exceptional situations, but most of all makes the plugin compatible with Nexus 2.7.0.
Also, some of the deprecated APIs are not used anymore.