/** * Copies a Maven-related JAR to the slave on demand. * Can also be used when run on master. * @param root the FS root of the slave (null means running on master) * @param representative a representative class present in the JAR * @param seedName the basename of the JAR * @param listener a listener for any problems * @return the (local or remote) absolute path of the JAR * @throws IOException in case copying fails * @throws InterruptedException in case copying is interrupted * @since 1.530 */ protected final String classPathEntry(FilePath root, Class<?> representative, String seedName, TaskListener listener) throws IOException, InterruptedException { if (root == null) { // master return Which.jarFile(representative).getAbsolutePath(); } else { return copyJar(listener.getLogger(), root, representative, seedName).getRemote(); } } /**