private static void addGroovyAndAntJars(JavaParameters params, Module module, String gantHome) {
    final File[] groovyJars = GroovyConfigUtils.getGroovyAllJars(gantHome + "/lib/");
    if (groovyJars.length > 0) {
      params.getClassPath().add(groovyJars[0].getAbsolutePath());
    }

    if (module == null) {
      return;
    }

    final String groovyHome = LibrariesUtil.getGroovyHomePath(module);
    if (groovyHome != null) {
      File[] libJars = GroovyUtils.getFilesInDirectoryByPattern(groovyHome + "/lib/", ".*\\.jar");
      if (libJars.length > 0) {
        params.getClassPath().addAllFiles(libJars);
      }
    }

    List<VirtualFile> classpath = params.getClassPath().getRootDirs();

    String[] characteristicClasses = ContainerUtil.ar(
      LibrariesUtil.SOME_GROOVY_CLASS, "org.apache.tools.ant.BuildException", "org.apache.tools.ant.launch.AntMain",
      "org.apache.commons.cli.ParseException");
    for (String someClass : characteristicClasses) {
      if (!LibraryUtil.isClassAvailableInLibrary(classpath, someClass)) {
        VirtualFile jar = LibrariesUtil.findJarWithClass(module, someClass);
        if (jar != null) {
          params.getClassPath().add(jar);
        }
      }
    }
  }
private static void addGroovyAndAntJars(JavaParameters params, Module module, String gantHome)