title: How do I add a project as JAR as a dependency of another project? (Gradle)
body: <p>I have had a generated Gradle project existing of the root project <code>Racer</code> and a few others (Racer-desktop, Racer-core...) Now I wanted to add one, namely <code>Racer-server</code>. This project should, just like the other ones, depend on the <code>Racer-core</code> project. What I've tried: add it to settings.gradle: </p>
  
  <pre><code> include 'android', 'ios', 'html', 'core', 'desktop', 'server' 
  </code></pre>
  
  <p>Added this stub to my Racer (root) build.gradle :  </p>
  
  <pre><code>project(":server") { 
  apply plugin: "java"
  apply plugin: 'war'
  
  dependencies { 
  
       compile project(":core")    
  }
  </code></pre>
  
  <p>and my <code>Racer-server</code>'s build.gradle contains this (mostly inspired by the files in the existing projects): </p>
  
  <pre><code>buildscript {
  repositories {
      mavenCentral()
  }
  dependencies {
      classpath 'com.google.appengine:gradle-appengine-plugin:1.9.6'
      }
  }
  
  apply plugin: 'war'
  apply plugin: 'appengine'
  
  sourceCompatibility = 1.7
  sourceSets.main.java.srcDirs = [ "src/" ]
  sourceSets.main.compileClasspath +=     files(project(':core').sourceSets.main.allJava.srcDirs)
  version = '1.0'
  
  eclipse {
  project {
      name = appName + "-server" //Racer-server
  }}
  </code></pre>
  
  <p>Now when I run Gradle->Refresh All it seems to do (regarding adding the core project) is this:<img src="https://i.stack.imgur.com/Ot9eI.png" alt="eclipse project properties"> It did add something, however "core" isn't even the name of the project, it's Racer-core on all the other projects.  </p>
  
  <p>What I want is that the core project gets compiled into a jar and added as a dependency to my server project, because the server i'm using (Google App Engine) requires a linked project to be as a jar.   </p>
  
  <p>Can this be done using Gradle?   </p>