includeBuild and multi-project names

I have a multi-project and a build that optionally leverages composite building to include the multi-project

My multi-project has three subprojects: client, shared, service.

my-service settings.gradle


client and service can then both declare the project(':shared') dependency.

They are set up to generate and publish jars named my-service, my-service-client, and my-service-shared.

My other project it set up to use the correct dependency coordinates and optionally includeBuild(my-service) if it is available on the file system. The build is failing for me when it is in the file system. Which make sense to me now since the group is correct, but the project name is the one used in settings.gradle.

The main things I want to accomplish are:

  • be able to prefix the names of artifacts without needing to include them in the project names (i.e. I wanted to avoid project(':my-service-client') in my dependencies
  • Use includeBuild to include the multi-project without needing to configure dependency substitution

Is there a good way to do that that I’ve just missed?

Is it really the project name that is your main concern, or the folder names on disk. If the latter, it’s easy to solve. If the former then I don’t think there is another way.

Thanks @Vampire, that’s the answer I was expected. I just wanted to see if I was missing something. I’ll adjust my project names.

1 Like