We have a monorepo that consists of multiple projects that contain a build file. How to ensure that all these projects will be built when the job is triggered?

One solution I am thinking about is creating a shell script that detects whether the folders contains a build script, add the name to a set, iterate on this set and trigger a build for all of the projects. I wonder whether this is a good approach, but it feels cumbersome.

1 Answer 1


Build tools like or could benefit you greatly here. It would do exactly what you have in mind as long as you have child project definition (with a build.gradle in gradle or pom.xml in maven).

I would not recommend the script as it would mean you have to maintain and tweak it in the future. Instead, investing in build tools can give you great ROI as they do much more than just build.

At the end if you cannot integrate a build tool, go for the script. It is a good idea also.

  • Could you give an example how a cradle file that is to build all projects when this job is triggered?
    – 030
    Dec 1, 2017 at 6:42
  • What are you trying to build? Java? C++? Multi language? I proposed gradle as an example because of its generality. It is more of a groovy task manager that gives you incredible flexibility on the way you want to build your projects then enforcing you a specific pattern. Here is a link on the multi-project concept: docs.gradle.org/current/userguide/…
    – gmolaire
    Dec 2, 2017 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.