Add apache dependency, and fix execution order