Refactor java-mvn functions