MavenProject (MavenBeforeRunTask task) { String pomXmlPath = task.getProjectPath(); if (StringUtil.isEmpty(pomXmlPath)) return null; VirtualFile file = LocalFileSystem.getInstance().findFileByPath(pomXmlPath); if (file == null) return null; return MavenProjectsManager.getInstance(myProject).findProject(file); }