title: Add custom maven repositories to build.gradle from Cordova
body: <p>I am trying to add <strong>programmatically</strong> a repository to my <code>build.gradle</code> file.</p>
  
  <p>According to <a href="https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#configuring-gradle" rel="nofollow noreferrer">Cordova docs</a> it is possible to extend <code>build.gradle</code> via a <code>build-extras.gradle</code> file that is en the same directory of <code>build.gradle</code> directory.</p>
  
  <p>The problem is that the repo is not added/linked because the gradle sync stills failing. </p>
  
  <p>This is my build-extras.gradle file:</p>
  
  <pre><code>buildscript {
    repositories {
        google()
      }
  }
  </code></pre>
  
  <p>I need to add <code>google()</code> repo to my <code>build.gradle</code> for example inside this:</p>
  
  <pre><code>buildscript {
      repositories {
  
          //google() &lt;-- here
          jcenter()
          maven {
              url "https://maven.google.com"
          }
      }
  
      // Switch the Android Gradle plugin version requirement depending on the
      // installed version of Gradle. This dependency is documented at
      // http://tools.android.com/tech-docs/new-build-system/version-compatibility
      // and https://issues.apache.org/jira/browse/CB-8143
      dependencies {
          classpath 'com.android.tools.build:gradle:3.0.0'
      }
  }
  </code></pre>
  
  <p>But I founded the cordova docs info to extend instead edit the build.gradle</p>
  
  <p>Is it possible? What would be wrong into my build-extras.gradle?</p>