title: How to add bitbucket private repository in gradle with bitbucket api v2.0
body: <p>My gradle project is down because it has some dependencies on bitbucket repo and the bitbucket v1 api was deprecated. </p>
  
  <p>I've googled a lot about how to migrate to v2 but doesn't find a good solution.</p>
  
  <p>The v1 api in gradle is like this:</p>
  
  <pre><code>repositories {
    maven {
          credentials {
              username "$mavenUser"
              password "$mavenPassword"
          }
          url "https://api.bitbucket.org/1.0/repositories/&lt;Team&gt;/&lt;repo&gt;/raw/&lt;branch&gt;"
    }
  }
  </code></pre>