boolean (String sourceFolderUrl, Project project) { URL url = VfsUtilCore.convertToURL(sourceFolderUrl); if (url == null) return false; VirtualFile sourceFolder = VfsUtil.findFileByURL(url); if (sourceFolder == null) return false; MavenProjectsManager mavenProjectsManager = MavenProjectsManager.getInstance(project); MavenProject containingProject = ReadAction.compute(() -> mavenProjectsManager.findContainingProject(sourceFolder)); if (containingProject != null) { Module module = ReadAction.compute(() -> mavenProjectsManager.findModule(containingProject)); if (module == null) return false; for (ContentEntry contentEntry : ModuleRootManager.getInstance(module).getContentEntries()) { if (contentEntry.getUrl().equals(sourceFolderUrl)) { return true; } } } return false; }