@Test public void createClassloaderFromCpFiles() { assertThat(res.getDependencies()).hasSize(4); Optional<ClassLoader> classLoader = CompilerClassloaderUtils.createClassloaderFromStringDeps(res.getDependencies()); assertThat(classLoader).isPresent(); assertThat(classLoader.get()).isNotNull(); }
public static Optional<ClassLoader> createClassloaderFromStringDeps(List<String> depsProject) { List<URL> deps = readAllDepsAsUrls(depsProject); if (deps.isEmpty()) { return Optional.empty(); } else { URLClassLoader urlClassLoader = new URLClassLoader(deps.toArray(new URL[deps.size()])); return Optional.of(urlClassLoader); } }
CompilerClassloaderUtils { public static Optional<ClassLoader> createClassloaderFromStringDeps(List<String> depsProject) { List<URL> deps = readAllDepsAsUrls(depsProject); if (deps.isEmpty()) { return Optional.empty(); } else { URLClassLoader urlClassLoader = new URLClassLoader(deps.toArray(new URL[deps.size()])); return Optional.of(urlClassLoader); } } }
CompilerClassloaderUtils { public static Optional<ClassLoader> createClassloaderFromStringDeps(List<String> depsProject) { List<URL> deps = readAllDepsAsUrls(depsProject); if (deps.isEmpty()) { return Optional.empty(); } else { URLClassLoader urlClassLoader = new URLClassLoader(deps.toArray(new URL[deps.size()])); return Optional.of(urlClassLoader); } } private  CompilerClassloaderUtils(); }
CompilerClassloaderUtils { public static Optional<ClassLoader> createClassloaderFromStringDeps(List<String> depsProject) { List<URL> deps = readAllDepsAsUrls(depsProject); if (deps.isEmpty()) { return Optional.empty(); } else { URLClassLoader urlClassLoader = new URLClassLoader(deps.toArray(new URL[deps.size()])); return Optional.of(urlClassLoader); } } private  CompilerClassloaderUtils(); static Optional<ClassLoader> getClassloaderFromAllDependencies(String prjPath,
                                                                          String localRepo,
                                                                          String settingsXmlPath); static Map<String, byte[]> getMapClasses(String path,
                                                    Map<String, byte[]> store); static Predicate<File> filterClasses(); static Optional<ClassLoader> loadDependenciesClassloaderFromProject(String prjPath,
                                                                               String localRepo); static Optional<ClassLoader> loadDependenciesClassloaderFromProject(List<String> poms,
                                                                               String localRepo); static Optional<ClassLoader> getClassloaderFromProjectTargets(List<String> pomsPaths); static List<URL> buildUrlsFromArtifacts(String localRepo,
                                                   List<Artifact> artifacts); static List<URL> getDependenciesURL(List<String> poms,
                                               String localRepo); static List<URL> getTargetModulesURL(List<String> pomsPaths); static Optional<ClassLoader> createClassloaderFromStringDeps(List<String> depsProject); static List<URL> readAllDepsAsUrls(List<String> prjDeps); static List<URI> readAllDepsAsUris(List<String> prjDeps); static List<String> readItemsFromClasspathString(Set<String> depsModules); static List<String> getStringFromTargets(Path prjPath); static List<String> getStringFromTargetWithStream(Path pathIn,
                                                             String... extensions); static List<URI> processScannedFilesAsURIs(List<String> classPathFiles); static List<URL> processScannedFilesAsURLs(List<String> classPathFiles); static Set<String> filterPathClasses(Collection<String> paths,
                                                String mavenRepoPath); static List<String> filterClassesByPackage(Collection<String> items,
                                                      String packageName); static Class<?> getClass(String pkgName,
                                    String className,
                                    ClassLoader classloader); }
CompilerClassloaderUtils { public static Optional<ClassLoader> createClassloaderFromStringDeps(List<String> depsProject) { List<URL> deps = readAllDepsAsUrls(depsProject); if (deps.isEmpty()) { return Optional.empty(); } else { URLClassLoader urlClassLoader = new URLClassLoader(deps.toArray(new URL[deps.size()])); return Optional.of(urlClassLoader); } } private  CompilerClassloaderUtils(); static Optional<ClassLoader> getClassloaderFromAllDependencies(String prjPath,
                                                                          String localRepo,
                                                                          String settingsXmlPath); static Map<String, byte[]> getMapClasses(String path,
                                                    Map<String, byte[]> store); static Predicate<File> filterClasses(); static Optional<ClassLoader> loadDependenciesClassloaderFromProject(String prjPath,
                                                                               String localRepo); static Optional<ClassLoader> loadDependenciesClassloaderFromProject(List<String> poms,
                                                                               String localRepo); static Optional<ClassLoader> getClassloaderFromProjectTargets(List<String> pomsPaths); static List<URL> buildUrlsFromArtifacts(String localRepo,
                                                   List<Artifact> artifacts); static List<URL> getDependenciesURL(List<String> poms,
                                               String localRepo); static List<URL> getTargetModulesURL(List<String> pomsPaths); static Optional<ClassLoader> createClassloaderFromStringDeps(List<String> depsProject); static List<URL> readAllDepsAsUrls(List<String> prjDeps); static List<URI> readAllDepsAsUris(List<String> prjDeps); static List<String> readItemsFromClasspathString(Set<String> depsModules); static List<String> getStringFromTargets(Path prjPath); static List<String> getStringFromTargetWithStream(Path pathIn,
                                                             String... extensions); static List<URI> processScannedFilesAsURIs(List<String> classPathFiles); static List<URL> processScannedFilesAsURLs(List<String> classPathFiles); static Set<String> filterPathClasses(Collection<String> paths,
                                                String mavenRepoPath); static List<String> filterClassesByPackage(Collection<String> items,
                                                      String packageName); static Class<?> getClass(String pkgName,
                                    String className,
                                    ClassLoader classloader);  }