Build 2 maven repositories

Hi,
I have repository A and B. B has projects that depends on A. How can I specify that on commit to B, clone 2 repositories and build A first (mvn clean install) and then B?

Thank you.