Fix for #239

Unfortunately I can't really test this because my build environment is very (very) different than Couchbase's. Once couchbase switches to using gradle properties then everything will be fine. But that's a different bug.

The only interesting change is that I introduced a new variable, MAVEN_BUILD_LOCAL. If set to true then the system will upload to mavenLocal(). Otherwise it will upload to the Maven depot specified by MAVEN_UPLOAD_REPO_URL.