title: Java - Package conflict on dependencies, force to choose from one
body: <p>I have project which has some dependencies, I am using Gradle.  </p>
  
  <p>I am declaring them by:</p>
  
  <pre><code>dependencies {
    compile 'org.json:json:20180130'
    compile 'com.test.myapi:1.0.1'
  }
  </code></pre>
  
  <p>the <code>com.test.myapi:1.0.1</code> jar has org.json inside it (Really bad deprecated thing I have..).<br>
  Now, I need to use the function <code>JSONTokener</code> which has new constructor in the latest version, and I do not have it in my <code>com.test.myapi</code> package.</p>
  
  <p>The build successfully creating me jar and tgz as I taking distroJar, but I am getting runtime error because for some reason it takes the <code>JSONTokener</code> method from the old version.</p>
  
  <p>Is there any way to force the project taking org.json from the new one, or disable the org.json from the internal package?</p>
  
  <p>Thanks.</p>