Method addURL = null;
try {
addURL = sysclass.getDeclaredMethod("addURL", new Class[] { URL.class });
addURL.setAccessible(true);
} catch (Throwable t) {
throw new MoxieException("Error, could not access class loader!", t);
}
for (String path : cp) {
try {
addURL.invoke(sysloader, new Object[] { new File(path).toURI().toURL() });
build.getConsole().debug(1, "{0}", path);
} catch (Throwable t) {
throw new MoxieException(MessageFormat.format(
"Error, could not add {0} to classloader", path), t);
}
}
} else {
build.getConsole().error("Skipping update classpath. Unexpected class loader {0}", loader.getClass().getName());