My question had been addressed in this thread, but the explanation is not clear.
I have this build definition in one of my pom.xml files:
Just a crazy idea: use modules
Define a parent pom like this:
pom
org.example my-parent 1.0 pom use-pom1 pom1 use-pom2 pom2
Define the desired extensions on pom1 and pom2.
pom1
pom2