Use ignoreExitValue true. Example given below task mkImages(type: Exec) { workingDir '../' commandLine './scripts/mkimages.sh' ignoreExitValue true}