String ( Element xmlProject, Collection<MavenProjectProblem> problems, VirtualFile file, boolean isAutomaticVersionFeatureEnabled) { String version = MavenJDOMUtil.findChildValueByPath(xmlProject, "parent.version"); if (version != null || !isAutomaticVersionFeatureEnabled) { return StringUtil.notNullize(version, UNKNOWN); } String parentGroupId = MavenJDOMUtil.findChildValueByPath(xmlProject, "parent.groupId"); String parentArtifactId = MavenJDOMUtil.findChildValueByPath(xmlProject, "parent.artifactId"); if (parentGroupId == null || parentArtifactId == null) { problems.add(new MavenProjectProblem(file.getPath(), MavenProjectBundle.message("consumer.pom.cannot.determine.parent.version"), MavenProjectProblem.ProblemType.STRUCTURE, false)); return UNKNOWN; } String relativePath = MavenJDOMUtil.findChildValueByPath(xmlProject, "parent.relativePath", "../pom.xml"); VirtualFile parentFile = file.getParent().findFileByRelativePath(relativePath); if (parentFile == null) { problems.add(new MavenProjectProblem(file.getPath(), MavenProjectBundle.message("consumer.pom.cannot.determine.parent.version"), MavenProjectProblem.ProblemType.STRUCTURE, false)); return UNKNOWN; } Element parentXmlProject = readXml(parentFile, problems, MavenProjectProblem.ProblemType.SYNTAX); version = MavenJDOMUtil.findChildValueByPath(parentXmlProject, "version"); if (version != null) { return version; } return calculateParentVersion(parentXmlProject, problems, parentFile, isAutomaticVersionFeatureEnabled); }