MavenProject (SelectInContext context) { VirtualFile file = context.getVirtualFile(); MavenProjectsManager manager = MavenProjectsManager.getInstance(context.getProject()); Module module = ProjectRootManager.getInstance(context.getProject()).getFileIndex().getModuleForFile(file); return module == null ? null : manager.findProject(module); }