String (String propName) { boolean hasPrefix = false; String unprefixed = propName; if (propName.startsWith("pom.")) { unprefixed = propName.substring("pom.".length()); hasPrefix = true; } else if (propName.startsWith("project.")) { unprefixed = propName.substring("project.".length()); hasPrefix = true; } MavenProject selectedProject = mavenProject; while (unprefixed.startsWith("parent.")) { if (selectedProject == null) return null; MavenId parentId = selectedProject.getParentId(); if (parentId == null) return null; unprefixed = unprefixed.substring("parent.".length()); if (unprefixed.equals("groupId")) { return parentId.getGroupId(); } if (unprefixed.equals("artifactId")) { return parentId.getArtifactId(); } if (unprefixed.equals("version")) { return parentId.getVersion(); } selectedProject = mavenProjectsManager.findProject(parentId); if (selectedProject == null) return null; } if (unprefixed.equals("basedir") || (hasPrefix && mavenProject == selectedProject && unprefixed.equals("baseUri"))) { return null == selectedProject ? null : selectedProject.getDirectory(); } if ("java.home".equals(propName) && null != mavenProject) { String jreDir = MavenUtil.getModuleJreHome(mavenProjectsManager, mavenProject); if (jreDir != null) { return jreDir; } } if ("java.version".equals(propName) && null != mavenProject) { String javaVersion = MavenUtil.getModuleJavaVersion(mavenProjectsManager, mavenProject); if (javaVersion != null) { return javaVersion; } } String result; result = MavenUtil.getPropertiesFromMavenOpts().get(propName); if (result != null) return result; if (null == mavenProject) return null; result = mavenProject.getMavenConfig().get(propName); if (result != null) return result; result = mavenProject.getJvmConfig().get(propName); if (result != null) return result; result = MavenServerUtil.collectSystemProperties().getProperty(propName); if (result != null) return result; result = selectedProject.getModelMap().get(unprefixed); if (result != null) return result; result = additionalPropertySource.get(propName); if (result != null) return result; result = mavenProject.getProperties().getProperty(propName); if (result != null) return result; if ("settings.localRepository".equals(propName)) { return mavenProject.getLocalRepository().getAbsolutePath(); } return null; }