title: How to upload Archives for several modules by using gradle?
body: <p>I want to publish my SDK in maven with <code>$ ./gradlew uploadArchives</code></p>
  
  <p>I had this project structure:</p>
  
  <pre><code>MyProject
  
    |_ SDK
       |_ src
           |_ main
                |_ java
                     |_ java files
       |_ build.gradle
    |_ gradle
          |_ gradle-publish.gradle
  </code></pre>
  
  <p>I used following code (<code>gradle-publish.gradle</code>) that works as expected:</p>
  
  <pre><code>task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
      classifier = 'javadoc'
      from androidJavadocs.destinationDir
  }
  
  task sourcesJar(type: Jar) {
      classifier = 'sources'
      from android.sourceSets.main.java.sourceFiles
  }
  
  uploadArchives {
      repositories {
          mavenDeployer {
           /* ... */
          }
      }
  }
  
  artifacts {
      archives sourcesJar
      archives androidJavadocsJar
  }
  </code></pre>
  
  <hr>
  
  <p>Now I splitted main module to 2: <code>SDK</code> and <code>new_module</code> so my project structure looks like:</p>
  
  <pre><code>MyProject
  
    |_ SDK
       |_ src
           |_ main
                |_ java
                     |_ java files  "com.app"
       |_ build.gradle
  
   |_ new_module
       |_ src
           |_ main
                |_ java
                     |_ java files "com.app.mod"
        |_ build.gradle
    |_ gradle
          |_ gradle-publish.gradle
  </code></pre>
  
  <p>However no matter what I do, I always get only <code>SDK</code> sources and not <code>new_module</code> a.e. <code>com.app</code> should be merged with <code>com.app.mod</code></p>
  
  <p>I tried to play with <code>sourceSets</code> but it looks like it works inside main module <code>SDK</code> and not under root project:</p>
  
  <pre><code>sourceSets {
      main{
        java {
          srcDirs(
                  "src/main/java",
                   "../new_module/src/main/java"
          )
      }
  }
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>task sourcesJar(type: Jar) {
     classifier = 'sources'   
     from android.sourceSets.main.java.srcDirs    
  }
  </code></pre>
  
  <p>Any ideas, tips? </p>
  
  <p><strong>Edit</strong></p>
  
  <p>I added </p>
  
  <pre><code>sourceSets {
      main{
        java {
  
          srcDirs("src/main/java",
                  "${root_dir}/new_module/src/main/java"
          )
        }
      }
    }
  </code></pre>
  
  <p>However on maven I see all have sources but <code>classes.jar</code> contains only <code>app</code> <code>.class</code> files</p>