Composite build substitution rules are changing

I am trying to use composite builds and use substitution, my structure is like this:

– sub1
– sub2

– compositeA
---- subA1
---- subA2

– compositeB
---- subB1
---- subB2

where compositeA and compositeB are composite builds, subA1, subA2, subB1, subB2 are submodules of those composite builds.
the expected behavior for me is to get subA1 by calling, sub1 by
However gradle is substituting subA1 by compositeA:subA1 . how to force my wanted substitution?

Sounds like subA1 does not have a group set and therefore the default value is being used. The default group value for a project uses its path, using dots as separators. So if the root project’s name is “compositeA”, then that will be the default group ID for subA1.

subA1 have a group set.
Actually if I execute gradlew from rootProject the replacement works as I expected.
If I call it from compositeA it doesn’t work.
What I actually have is, subA2 depends on sub1, sub1 depends on subA1 .

  • If I call a task from rootProject (where sub1 and sub2live)subA1got resolved as I expectgroup:subA1`
  • If I cal a task from compositeA ( a circular dependency happen) and subA1 got resolved using compositeA:subA1

Can you create an example project that recreates what you are seeing and share it? I think that will help us.