GRADLE-2762 - fix publishing to mavenLocal to follow maven rules

Change the PublishToMavenLocal tasks to utilize the Maven Ant
InstallTask under the hood instead of DeployTask. Fixes the issue
where snapshots were being deployed as unique versions to mavenLocal.
Merge branch 'gradle-2762' of https://github.com/johnrengelman/gradle
GRADLE-2762: Pulled up common code into parent class and added tests.