Use gradle-nexus-plugin
Use gradle-nexus-plugin

It provides out of the box tasks for:
 - attaching sources, javadoc artifacts
 - signing archives
 - deploy configuration for maven central

jcgay/gradle-notifier