Maven-publish - getting some empty poms for interstitial directories

We have a multi-module project - around 300+ modules using gradle 8.0.2 & Java 17

We have a directory structure such as:


The 4 directories named client,server contains a build.gradle, as does the top level /
Only these directories feature in settings.gradle with a project definition

Currently the maven publish configuration is in the subProjects section of the top level build.gradle, and we have another specific configuration in the bom (as it’s a bit different)

When we publish (ie publishToMavenLocal) I notice I am getting a maven artifact for the interstitial directories, ie ‘area1’, or ‘area2’ or ‘area2.subarea1’, We don’t want these - the directory structure is purely for our own needs

We did have exactly this with maven, but I had hoped this wouldn’t be the case with gradle

Where did I go wrong?

Ah I just found Multi-project builds with empty levels - #3 by David_Held

Moving to use convention plugins, and declaring specifically in each module is on the todo list…

I do notice these intermediate projects have a null description - I can probably use this to exclude…

1 Like

For now, I’ve added a condition

if (project.buildFile.exists()) {


in my subprojects