Stop build manually w/o exception


we want to use Gradle for automate some (general) processes:

  • Download file from FTP
  • Validate file
  • Import file into database

I can achieve all these steps with custom tasks or with e.g. the ssh plugin for downloading from FTP. The only thing I’m not able is to stop the “build” process without an exception. In my case an non-existing file on the FTP (which I’m trying to download) should not end with a build failure. I can skip the following tasks with some “onlyIf”-condition. But this is a bit ugly when I have a lot of following tasks.

Is there a way to stop the build process without throwing an exception ending with a build failure?