}
if (module instanceof ConnectorModule) {
ConnectorModule connectorModule = (ConnectorModule) module;
final ClassLoader connectorClassLoader = connectorModule.getClassLoader();
return new AnnotationFinder(new ClasspathArchive(connectorClassLoader, connectorModule.getLibraries())).link();
}
if (module.getJarLocation() != null) {
String location = module.getJarLocation();
File file = new File(location);
URL url;
if (file.exists()) {
url = file.toURI().toURL();
File webInfClassesFolder = new File(file, "WEB-INF/classes");
if (webInfClassesFolder.exists() && webInfClassesFolder.isDirectory()) {
url = webInfClassesFolder.toURI().toURL();
}
} else {
url = new URL(location);
}
return new AnnotationFinder(new ClasspathArchive(module.getClassLoader(), url)).link();
} else {
return new AnnotationFinder(new ClassesArchive()).link();
}
}