private String getJobDefinedMavenInstallation(BuildListener listener, VirtualChannel channel) { Maven.MavenInstallation mvn = getMavenInstallation(); if (mvn == null) { listener.error( "Maven version is not configured for this project. Can't determine which Maven to run"); throw new Run.RunnerAbortedException(); } String mvnHome = mvn.getHome(); if (mvnHome == null) { listener.error("Maven '%s' doesn't have its home set", mvn.getName()); throw new Run.RunnerAbortedException(); } return mvnHome; }