Adding a sort to ensure the build directories come out in consistent order, with the root pom first
This occassionally matters when the main POM tree has content used in other POM trees. It is a heuristic, since it could as easily be the other way, but it is more common for something like 'testing' to rely on 'common' than vice versa.
The old python script for detecting build directories had this sort, but the switch to shell scripting (!957 (merged)) dropped it by mistake.
Edited by David Diederich