void (List<File> classpath) { List<String> resources = getIndexerRTList(); File libDir = MavenUtil.getPluginSystemDir("rt-maven-indexer-lib").toFile(); if (!libDir.isDirectory()) { if (!libDir.mkdirs()) { throw new PluginException("Cannot create cache directory for maven", PluginId.getId(MavenUtil.INTELLIJ_PLUGIN_ID)); } } for (String jarName : resources) { File file = new File(libDir, jarName); if (!file.isFile()) { try (InputStream is = MavenIndexerCMDState.class.getClassLoader() .getResourceAsStream(jarName); OutputStream bos = new BufferedOutputStream(new FileOutputStream(file)) ) { if (is == null) { throw new PluginException("Cannot find runtime library " + jarName + " in resources", PluginId.getId(MavenUtil.INTELLIJ_PLUGIN_ID)); } StreamUtil.copy(is, bos); } catch (IOException e) { throw new PluginException("Cannot copy runtime library " + jarName + " into " + file, e, PluginId.getId(MavenUtil.INTELLIJ_PLUGIN_ID)); } } classpath.add(file); } }