We do have exactly the same problem as described in the old post above. Since the post is 4 years old I would hope for a solution being available now. Can someone point me in the right direction?
That case is now covered by composite builds. Rather than conditionally choosing between external and project dependencies as shown in the “elastic” example, treat all as external, but include all the local builds in the composite. Dependency substitution will use the local builds wherever possible, regardless of level (direct or transitive).