Set subproject group

My project structure and I have 6 projects now including the rootProject.

Project A and Project B are the same group “com.abc” while ProjectC/D/E are belong to “com.abc.ext”

I have mentioned all the projects in the settings.gradle

/projA

/projB

/ext

/projC

/projD

/projE

/build.gradle

/settings.gradle

My question is how to set subproject group.

One of the solution is to create the gradle.properties in each project C/D/E. Another solution is to work inside the build.gradle and then update the group by its path?

But I want to know if it is possible to put a gradle.properties in ext folder which share among the project.( I tried but fail)

Apart from different namespace, is it possible to exclude the ext project (where i mention ext:projC…etc. in the settings.gradle) ?

I don’t want to hard code like this

but if i change from ext:projC into the ext/projC. Its artifact Id will become ext/projC and fail to publish due to invalid name,

Thanks.