Fix build directory for spring boot application

I have a multi project solution, api and ui, both have their respective build.gradle. Api is a springboot-kotlin application.

When ever I run bootRun in parent folder, one build folder is created in parent folder and one in api folder with same content.

Is there a way to configure so that build folder only will created in api folder , which is needed.