How to make System command calls in Java/Groovy?

前端 未结 4 1628
眼角桃花
眼角桃花 2021-01-31 16:01

What I want to do is invoke maven from a groovy script. The groovy script in question is used as a maven wrapper to build J2EE projects by downloading a tag and invoking maven o

4条回答
  •  孤城傲影
    2021-01-31 16:37

    For Java 7+ stdio redirection:

    new ProcessBuilder('cmd', …args…).redirectOutput(ProcessBuilder.Redirect.INHERIT).start().waitFor();
    

提交回复
热议问题