I am writing custom plugin, which creates pom.xml file with required dependencies and than i want to import project with the help of IntellijIDEA. I am going to do it with this code
MavenOpenProjectProvider openProjectProvider = new MavenOpenProjectProvider();
And thats why i need to have pomMvnFile of VirtualFile type. I am trying to find VirtualFile with this code:
FilenameIndex.getFilesByName(activeProject, "pom.xml", GlobalSearchScope.projectScope(activeProject));
When i open already existed maven project, than i can find VirtualFile. But when i open the same project and do 'Unlink maven project' (without deleting any files), than i cannot find pom.xml file. Can anybody explain why this happended and how i can get VirtualFile?