title: Gradle - inherit repositories from a module
body: <p>First of all, I explain my project setups. I use the words Project/Module as used in Android Studio.</p>
  
  <p>I have a setup of my projects like following:</p>
  
  <ul>
  <li><p>LibraryProject => a project that just groups my libraries, that I use in other projects, if necessary</p>
  
  <ul>
  <li>BackupLibrary (Module)</li>
  <li>DatabseLibrary (Module)</li>
  <li>MainUtilityLibrary (Module)</li>
  <li>DialogLibrary (Module)</li>
  </ul></li>
  <li><p>MyProject1</p>
  
  <ul>
  <li>App (Project)</li>
  <li>DialogLibrary (Module, referenced from DIRFFERENT project)</li>
  </ul></li>
  </ul>
  
  <p><strong>My Project1 now looks like following:</strong></p>
  
  <p>1) I reference the module from the other project, that I want to use (done in <code>settings.gradle (Project Settings)</code> file:</p>
  
  <pre><code>include ':app'
  
  include ':dialogLibrary '
  project(':dialogLibrary ').projectDir = new File(settingsDir, '../LibraryProject/DialogLibrary ')
  </code></pre>
  
  <p>2) I add the foreign library module as a dependency to my app's <code>build.gradle</code>:</p>
  
  <pre><code>dependencies {
      compile project(':dialogLibrary ')
  }
  </code></pre>
  
  <hr>
  
  <p><strong>My LibraryProject looks like following:</strong></p>
  
  <p>I add the repository and the dependency directly to the module's `build.gradle' (this is enough to build the module on it's own without a problem):</p>
  
  <pre><code>allprojects {
      repositories {
          maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
      }
  }
  
  dependencies {
      compile 'com.afollestad:material-dialogs:0.7.5.2'
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Problem</strong></p>
  
  <p>The setup so far does not work for MyProject1. I have to add <code>maven { url 'https://dl.bintray.com/drummer-aidan/maven' }</code> to MyProject1 as well, the <code>compile project(':dialogLibrary ')</code> is not enough. I have to add the dependency that should somehow be inherited from the LibraryModule to MyProject1 Project <code>build.gradle</code>again like following:</p>
  
  <pre><code>allprojects {
      repositories {
          mavenCentral()
          maven { url 'https://dl.bintray.com/drummer-aidan/maven' } // com.afollestad:material-dialogs
      }
  }
  </code></pre>
  
  <p>Otherwise, i can't compile my project. This way seems like doing something twice that probably can be done automatically. But how? This way, whenever I include a module from my LibraryProject, I have to check if I need an additional maven repo...</p>