VirtualFile (@NotNull Module module) { final VirtualFile[] files = OrderEnumerator.orderEntries(module).getAllLibrariesAndSdkClassesRoots(); for (VirtualFile root : files) { if (GroovyConfigUtils.GROOVY_JAR_PATTERN.matcher(root.getName()).matches() || GroovyConfigUtils.matchesGroovyAll(root.getName())) { return root; } } for (VirtualFile file : files) { if (file.getName().contains("groovy") && "jar".equals(file.getExtension())) { return file; } } return null; }