title: Why gradle removes dependency when I build a project
body: <p>I have no idea why gradle is doing this to me. I have a multiproject that looks like this:</p>
  
  <pre><code>|Parent
   |client
   |common
   |service
  </code></pre>
  
  <p>Parent is just an empty project and client, common and service are gradle java projects:
  I have some classes that are used in both client and service, therefore I wanted to create a common project and build a jar that I would later use in both service and client. I can build the common jar, but whenever i try to do 'add dependency on common' and then try to 'refresh gradle', it removes the dependency and fails to build!<br>
  This is what I do:
  <a href="https://i.stack.imgur.com/Ub7Kp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ub7Kp.png" alt="enter image description here"></a></p>
  
  <p>Then I press this because I want to build it:
  <a href="https://i.stack.imgur.com/B0wcU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B0wcU.png" alt="enter image description here"></a></p>
  
  <p>And it just removes the dependency!!!</p>
  
  <p><a href="https://i.stack.imgur.com/vqMzw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vqMzw.png" alt="enter image description here"></a></p>
  
  <p>This is build.gradle file from client project:</p>
  
  <pre><code>plugins {
  id 'org.springframework.boot' version '2.2.5.RELEASE'
  id 'io.spring.dependency-management' version '1.0.9.RELEASE'
  id 'java'
  }
  
  group = 'sot.rest'
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = '11'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      compile group: 'org.springframework', name: 'spring-web', version: '5.2.4.RELEASE'
      implementation 'org.springframework.boot:spring-boot-starter'
      // https://mvnrepository.com/artifact/com.google.code.gson/gson
      compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
  }
  </code></pre>
  
  <p>Please help, Im desperate!!</p>