Project A depends on B, using maven-publish, can I get dependencies of B to appear instead of B in A.pom?

I have a multi-project build with project A and project B that I control. Project A depends on B. They each have other external dependencies. Let’s say A also depends on ExternalX and B depends on ExternalY.
The artifact I produce from project A will be obfuscated with ProGuard such that the jars of A & B are combined into a single obfuscated jar.

I need the POM for “A-obfuscated” to declare the dependencies that A depends on directly (ExternalX) as well as the direct dependencies of B (ExternalY).

How can I automate this so I don’t have to explicitly declare ExternalY as a direct dependency of A?

Basically I don’t want to have to be burdened with keeping B’s dependencies declared in A as well even though they aren’t directly needed by A, as the projects evolve.