builder.addUrls(ReflectionsWorkaroundClasspathHelper.forPackage("", classLoaders)); builder.setClassLoaders(classLoaders); Reflections reflections = new Reflections(builder); Class<?> solutionClass = loadSolutionClass(reflections);
reflectionUrls.addAll(ClasspathHelper.forClassLoader(Thread.currentThread().getContextClassLoader())); ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); configurationBuilder.setClassLoaders(new ClassLoader[] { loader, Thread.currentThread().getContextClassLoader() }); configurationBuilder.setScanners(new SubTypesScanner(false), new TypeAnnotationsScanner(), new ResourcesScanner());
private PluginScanResult scanPluginPath( ClassLoader loader, URL[] urls ) throws InstantiationException, IllegalAccessException { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.setClassLoaders(new ClassLoader[]{loader}); builder.addUrls(urls); builder.setScanners(new SubTypesScanner()); builder.useParallelExecutor(); Reflections reflections = new InternalReflections(builder); return new PluginScanResult( getPluginDesc(reflections, Connector.class, loader), getPluginDesc(reflections, Converter.class, loader), getPluginDesc(reflections, HeaderConverter.class, loader), getPluginDesc(reflections, Transformation.class, loader), getServiceLoaderPluginDesc(ConfigProvider.class, loader), getServiceLoaderPluginDesc(ConnectRestExtension.class, loader) ); }