Rewrote in Java to avoid problems with unavailable dependencies in particular scala-mojo-support.