Is there a way to have a common dependency declare...
# gradle
v
Is there a way to have a common dependency declared in the root gradle file that all the modules in the project can use? For example: All modules make use of the KotlinStdLib so it would be nice to not have to redeclare it in all modules. Im using the kotlin dsl
o
Copy code
subprojects {
  dependencies { ... }
}
or make a new subproject, add the
java-library
plugin to it, add stdlib dependencies as
api(kotlin("..."))
, then depend on that using
implementation(project(":name-of-the-project"))
v
I tried using the
subprojects
block in the root file... However it is saying
Unresolved reference: implementation
o
you need to either add the appropriate plugin so that the accessors are generated, or use
"implementation"()
v
I currently am using a separate module with
api
, but I was hoping there was an easier way 🤔
what would be the appropriate plugin?
o
java
,
java-library
, the kotlin plugin
g
Submodules, or use buildSrc and write own simple plugin that implements all required conventions