This is similar issue to GRADLE-3233. In my case the version is left unspecified, but resolution strategy is configured to set desired version and pom.xml file is modified to add section.
I have prepared small example project to help reproduce this problem: https://github.com/hban/gradle-publish-npe. Build breaks with NPE when running publishToMavenLocal task. The same build will pass on Gradle 2.2.1.
Example project is a bit contrived - I’ve actually encounter this issue when using Spring’s dependency management plugin which performs similar steps to manage dependencies.
Thanks for reporting this issue: it’s been fixed and we’ve created a new release candidate for Gradle 2.3. If you can try it out to confirm that it fixes your build, that would really help.