How to make System command calls in Java/Groovy?

前端 未结 4 1627
眼角桃花
眼角桃花 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:16

    You may use Runtime class to launch a shell command. take a look here: http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html#exec(java.lang.String) You may later capture the results of the Process execution (to find out if it failed or not).

提交回复
热议问题