Skip to content

Instantly share code, notes, and snippets.

@kdabir
Created February 22, 2012 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdabir/1885185 to your computer and use it in GitHub Desktop.
Save kdabir/1885185 to your computer and use it in GitHub Desktop.
executing system process with groovy
// following process executes 'mvn compile' from a groovy script
// it can be replaced with any system program
Process compile = "cmd /c mvn compile".execute() // 'cmd /c' works only on win platform
compile.waitForProcessOutput(out, err)
if (out) println "out:\n$out"
if (err) println "err:\n$err"
exitValue = compile.exitValue()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment