}
}
private ClassFinder createFinder(String classloaderType) throws DependencyResolutionRequiredException, MalformedURLException,
Exception, MojoFailureException {
ClassFinder finder;
if ("project".equals(classloaderType)) {
List<URL> urls = new ArrayList<URL>();
for (Object object : project.getCompileClasspathElements()) {
String path = (String) object;
urls.add(new File(path).toURI().toURL());
}
ClassLoader loader = new URLClassLoader(urls.toArray(new URL[urls.size()]), getClass().getClassLoader());
finder = new ClassFinder(loader, urls);
} else if ("plugin".equals(classLoader)) {
finder = new ClassFinder(getClass().getClassLoader());
} else {
throw new MojoFailureException("classLoader attribute must be 'project' or 'plugin'");
}
return finder;
}