IDEA-101185 IntelliJ does not use systemPropertyVariables defined in maven-surefire-plugin configuration

This commit is contained in:
Sergey Evdokimov
2013-02-15 15:32:32 +04:00
parent cb4385efc6
commit be87fe52b6
@@ -42,18 +42,30 @@ public class MavenJUnitPatcher extends JUnitPatcher {
if (mavenProject == null) return;
Element config = mavenProject.getPluginConfiguration("org.apache.maven.plugins", "maven-surefire-plugin");
if (config == null) return;
List<String> paths = MavenJDOMUtil.findChildrenValuesByPath(config, "additionalClasspathElements", "additionalClasspathElement");
if (paths.isEmpty()) return;
if (paths.size() > 0) {
MavenDomProjectModel domModel = MavenDomUtil.getMavenDomProjectModel(module.getProject(), mavenProject.getFile());
MavenDomProjectModel domModel = MavenDomUtil.getMavenDomProjectModel(module.getProject(), mavenProject.getFile());
for (String path : paths) {
if (domModel != null) {
path = MavenPropertyResolver.resolve(path, domModel);
}
for (String path : paths) {
if (domModel != null) {
path = MavenPropertyResolver.resolve(path, domModel);
javaParameters.getClassPath().add(path);
}
}
javaParameters.getClassPath().add(path);
Element systemPropertyVariables = config.getChild("systemPropertyVariables");
if (systemPropertyVariables != null) {
for (Element element : (List<Element>)systemPropertyVariables.getChildren()) {
String propertyName = element.getName();
String value = element.getValue();
javaParameters.getVMParametersList().addProperty(propertyName, value);
}
}
}
}