We use "bazel query labels", which returns deps and runtime_deps conveniently, but there doesn't seem a way to order the output. It would be nice to preserve the BUILD file oder of deps and runtime deps for pom generation, and also pomgen query. We should consider just parsing the BUILD file ourselves to get deps and runtime deps - it isn't too complicated.