code: public Object call(final @Nullable Object[] args) throws Exception {
      if (args == null || args.length == 0) {
        throw new MojoExecutionException(FAILED);
      }
      else if (args.length == 1) {
        if (args[0] instanceof Throwable) {
          Throwable cause = (Throwable) args[0];
          throw new MojoExecutionException(cause.getMessage(), cause);
        }
        else {
          throw new MojoExecutionException(String.valueOf(args[0]));
        }
      }
      else if (args.length == 2) {
        if (args[1] instanceof Throwable) {
          throw new MojoExecutionException(String.valueOf(args[0]), (Throwable) args[1]);
        }
        else {
          throw new Error("Invalid arguments to fail(Object, Throwable), second argument must be a Throwable");
        }
      }
      else {
        throw new Error("Too many arguments; expected one of: fail(), fail(Object) or fail(Object, Throwable)");
      }
    }
docs: Throws {@link MojoExecutionException}.