Define dependency sets in parent project

Hi!

We are forced to switch from sbt to gradle so now I have some questions on how to better approach it
The structure of our project is something like this:

+ common-dependency1
+ common-dependency2
+ import-jobs
| + ijob1
| + ...
| + ijob15
+ export-jobs
  + ejob1
  + ...
  + ejob20

In sbt is is possible to define “dependency set” in a parent project, like

val deps =  Seq( "org.apache.spark" %% "spark-core" % sparkVersion.value % "provided",
      "org.apache.spark" %% "spark-sql" % sparkVersion.value % "provided")

then it is possible to use this set in subprojects. It is also possible to redefine sparkVersion in child projects.
Is it possible to do something like this in gradle? Or should I use a different approach?

Thanks

We are forced to switch from sbt to gradle

Welcome to the light side. :slight_smile:

For centrally declaring libraries with their versions and bundles of multilple libraries, Gradle has the version catalogs feature: Sharing dependency versions between projects