1

How can we declare a dependency as provided from another module? i.e. something like:

dependencies {
    compile 'javax.persistence:persistence-api:1.0'
    provided 'com.google.code.gson:gson:2.5'
}

but instead of pulling dependency from a repo, I want to include a project in another project. I would expect something like this to work:

dependency {
    compile 'javax.persistence:persistence-api:1.0'
    provided project(':mymodule')
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141

1 Answers1

2

Gradle does not have a built in provided scope/configuration. You can define your own provided configuration. See here: https://stackoverflow.com/a/34899917/745574

But in your case, you do not really need it. As long as mymodule is already in settings.gradle, just include your module as:

compile project(':mymodule')
Community
  • 1
  • 1
RaGe
  • 22,696
  • 11
  • 72
  • 104