PsiFile (MavenId id, ConvertContext context) { PsiFile res = super.resolve(id, context); if (res != null) return res; DomElement parent = context.getInvocationElement().getParent(); if (!(parent instanceof MavenDomDependency)) return null; DependencyConflictId dependencyId = DependencyConflictId.create((MavenDomDependency)parent); if (dependencyId == null) return null; MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(context.getProject()); VirtualFile file = getMavenProjectFile(context); MavenProject mavenProject = file == null ? null : projectsManager.findProject(file); if (mavenProject != null) { MavenArtifact artifact = mavenProject.getDependencyArtifactIndex().findArtifacts(dependencyId); if (artifact != null && MavenArtifactUtilKt.resolved(artifact)) { return super.resolve(new MavenId(id.getGroupId(), id.getArtifactId(), artifact.getVersion()), context); } } if (StringUtil.isEmpty(id.getVersion())) { MavenDomDependency managedDependency = MavenDomProjectProcessorUtils.searchManagingDependency((MavenDomDependency)parent); if (managedDependency != null) { final GenericDomValue<String> managedDependencyArtifactId = managedDependency.getArtifactId(); return RecursionManager.doPreventingRecursion(managedDependencyArtifactId, false, () -> { PsiElement res1 = new GenericDomValueReference(managedDependencyArtifactId).resolve(); return res1 instanceof PsiFile ? (PsiFile)res1 : null; }); } } return null; }