Executing external Processes using ProcessService
ProcessService is a bean which can be injected into a TaskType to execute external processes.
ProcessService uses the ExternalProcessBuilder to collect information such as the command, environment variables and working directory to be used to launch a new process. When the process is executed its output is automatically appended to the build log as it becomes available.
The following Task uses ProcessService to execute the
ls Unix/Linux/Mac utility to list the files and directories available in the working directory. The TaskResultBuilder is then used to check that the return code of the process is zero (e.g. that the task is successful).