1
votes

I have multiple projects configured using build.gradle for each and settings.gradle at the top level.

I want to define or use a single Gradle task that will build all of the subprojects and the root.

How do I run or create a single Gradle task to run all subprojects and root in a multi-project build?

1

1 Answers

2
votes

It depends on what all your projects are.

You can call gradle(w) build from the root dir if all your subprojects extend the javaplugin.

Other project types (like the ear plugin) need to be attached to the build task manually. The way I do this is by creating the build task like: task build and in the ear project: build.dependsOn ear