Refactor maven upload to reuse it in staging upload