repositories {
maven {
credentials {
username "$mavenUser"
password "$mavenPassword"
}
url "https://api.bitbucket.org/2.0/repositories/<Team>/<repo>/src/<branch>"
}
}
According to v2 API reference, I updated the url, and with curl -u username:password https://api.bitbucket.org/2.0/repositories/<Team>/<repo>/src/<branch>/<path>
I can get raw data, but gradle still not works and always Received status code 403 from server: Forbidden
After specify basic
authentication explicitly, gradle works as expected
repositories {
maven {
credentials {
username "$mavenUser"
password "$mavenPassword"
}
authentication {
basic(BasicAuthentication)
}
url "https://api.bitbucket.org/2.0/repositories/<Team>/<repo>/src/<branch>"
}
}
Below is gradle documentation
If no authentication schemes have been assigned to this repository, a default set of authentication schemes are used based on the repository's transport scheme.