// Does maven.home point to a Maven installation which satisfies mavenReqVersion?
String home = System.getProperty("maven.home");
if(home!=null) {
MavenInstallation mavenInstallation = new MavenInstallation("default",home, NO_PROPERTIES);
if (mavenInstallation.meetsMavenReqVersion(createLocalLauncher(), mavenReqVersion)) {
hudson.getDescriptorByType(Maven.DescriptorImpl.class).setInstallations(mavenInstallation);
return mavenInstallation;
}
}