Search code examples
android-studiogradleandroid-gradle-pluginjcenter

In gradle, can I compile a local module and use that as dependencies for other 'external' libraries?


I'm using a fork of Exoplayer in my project which I included as a git submodule and compile along my other modules:

compile project(':libraries:exoplayer:library')

Now I'm trying to link with an external SDK that has an explicit dependency to exoplayer in its pom file:

<dependency>
  <groupId>com.google.android.exoplayer</groupId>
  <artifactId>exoplayer</artifactId>
  <version>r1.4.2</version>
  <scope>compile</scope>
</dependency>

How can I tell gradle to use the fork of exoplayer and not the jcenter one ?


Solution

  • you can ignore the transitive dependency like this:

    dependencies{
      compile('your:external:sdk') {
        exclude group: 'com.google.android.exoplayer', module: 'exoplayer'
      }
    }