'Already seen doctype' - private maven repo host in BitBucket, cannot be accessed with Gradle 2.+

Previously with Gradle 1.x we could access a private Maven repo hosted on Bitbucket using the format

https://username:password@bitbucket.org/username/repo/raw/master

This no longer works using Gradle 2.x which is a major issue as it is stopping us from upgrading to the latest Android Studio and Intellij distros.

We are seeing ‘Already seen doctype’ as the credentials are no longer being accepted by BitBucket and therefore the html login screen is being returned.

If you have any suggestions about how to get this working that would be great.