set = new UrlSet(cl); if (cl.getParent() != cl) { set = set.exclude(cl.getParent()); set = set.exclude(".*/activation(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/activeio-core(-[\\d.]+)?(-incubator)?.jar(!/)?"); set = set.exclude(".*/activemq-(core|ra)(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/annotations-api-6.[01].[\\d.]+.jar(!/)?"); set = set.exclude(".*/asm-(all|commons|util|tree)?[\\d.]+.jar(!/)?"); set = set.exclude(".*/avalon-framework(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/axis2-jaxws-api(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/backport-util-concurrent(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/bcprov-jdk15(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/catalina(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/cglib-(nodep-)?[\\d.]+.jar(!/)?"); set = set.exclude(".*/com\\.ibm\\.ws\\.[^/]*.jar(!/)?"); set = set.exclude(".*/commons-(logging|logging-api|cli|pool|lang|collections|dbcp|dbcp-all)(-[\\d.r-]+)?.jar(!/)?"); set = set.exclude(".*/cxf-bundle(-[\\d.]+)?(incubator)?.jar(!/)?"); set = set.exclude(".*/openejb-cxf-bundle(-[\\d.]+)?(incubator)?.jar(!/)?"); set = set.exclude(".*/derby(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/ejb31-api-experimental(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/geronimo-(connector|transaction)(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/geronimo-[^/]+_spec(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/geronimo-javamail_([\\d.]+)_mail(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/hibernate-(entitymanager|annotations)?(-[\\d.]+(ga)?)?.jar(!/)?"); set = set.exclude(".*/howl(-[\\d.-]+)?.jar(!/)?"); set = set.exclude(".*/hsqldb(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/idb(-[\\d.]+)?.jar(!/)?"); set = set.exclude(".*/idea_rt.jar(!/)?");
public UrlSet excludePaths(String pathString) throws MalformedURLException { String[] paths = pathString.split(File.pathSeparator); UrlSet urlSet = this; for (String path : paths) { File file = new File(path); urlSet = urlSet.exclude(file); } return urlSet; }
public static UrlSet cullSystemJars(final UrlSet original) throws IOException { UrlSet urls = new UrlSet(original.getUrls()); urls = urls.exclude(ClassLoader.getSystemClassLoader().getParent()); urls = urls.excludeJvm(); urls = urls.excludePaths(System.getProperty("sun.boot.class.path", "")); urls = urls.exclude(".*/JavaVM.framework/.*"); return urls; }
private static Archive defaultArchive() { try { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); UrlSet urls = new UrlSet(classLoader); urls = urls.excludeJvm(); urls = urls.exclude(classLoader.getParent()); return new ClasspathArchive(classLoader, urls.getUrls()); } catch (final IOException e) { throw new IllegalStateException(e); } }
public UrlSet excludePaths(String pathString) throws MalformedURLException { String[] paths = pathString.split(File.pathSeparator); UrlSet urlSet = this; for (String path : paths) { File file = new File(path); urlSet = urlSet.exclude(file); } return urlSet; }
public UrlSet excludeJvm() throws MalformedURLException { UrlSet urls = excludeJavaHome().excludeJavaExtDirs().excludeJavaEndorsedDirs(); if (isOsx()) { urls = urls.exclude(new File("/System/Library/Java/Support")); } return urls; }
public static UrlSet cullSystemJars(final UrlSet original) throws IOException { final String sunboot = JavaSecurityManagers.getSystemProperty("sun.boot.class.path", ""); UrlSet urls = new UrlSet(original.getUrls()); urls = urls.exclude(ClassLoader.getSystemClassLoader().getParent()); urls = urls.excludeJvm(); if (!sunboot.isEmpty()) { // else on java9 it excludes new File(".") so all maven builds fail urls = urls.excludePaths(sunboot); } urls = urls.exclude(".*/JavaVM.framework/.*"); return urls; }
private static Archive cpArchive() { try { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); return new ClasspathArchive( classLoader, new UrlSet(classLoader).excludeJvm().exclude(classLoader.getParent()).getUrls()); } catch (final IOException e) { throw new IllegalStateException(e); } }
public UrlSet excludeJavaHome() throws MalformedURLException { String path = System.getProperty("java.home"); File java = new File(path); if (path.matches("/System/Library/Frameworks/JavaVM.framework/Versions/[^/]+/Home")){ java = java.getParentFile(); } return exclude(java); }
public UrlSet excludeJavaHome() throws MalformedURLException { String path = System.getProperty("java.home"); File java = new File(path); if (isOsx() && path.endsWith("/Contents/Home")) { java = java.getParentFile().getParentFile(); } return exclude(java); }
public UrlSet excludeJavaHome() throws MalformedURLException { String path = System.getProperty("java.home"); File java = new File(path); if (isOsx() && path.endsWith("/Contents/Home")) { java = java.getParentFile().getParentFile(); } return exclude(java); }
public static UrlSet cullOpenEJBJars(final UrlSet original) throws IOException { UrlSet urls = new UrlSet(original.getUrls()); urls = urls.exclude(".*openejb.*"); return urls; }
private static Collection<URL> getUrls(final ClassLoader classLoader, final ClassLoader excludeParent) throws IOException { UrlSet urlSet = new UrlSet(classLoader); if (excludeParent != null) { urlSet = urlSet.exclude(excludeParent); } return urlSet.getUrls(); }
private static Collection<URL> getUrls(ClassLoader classLoader, ClassLoader excludeParent) throws IOException { UrlSet urlSet = new UrlSet(classLoader); if (excludeParent != null){ urlSet = urlSet.exclude(excludeParent); } return urlSet.getUrls(); }
private static Collection<URL> getUrls(ClassLoader classLoader, ClassLoader excludeParent) throws IOException { UrlSet urlSet = new UrlSet(classLoader); if (excludeParent != null){ urlSet = urlSet.exclude(excludeParent); } return urlSet.getUrls(); }
private static Collection<URL> getUrls(ClassLoader classLoader, ClassLoader excludeParent) throws IOException { UrlSet urlSet = new UrlSet(classLoader); if (excludeParent != null){ urlSet = urlSet.exclude(excludeParent); } return urlSet.getUrls(); }
private static Collection<URL> getUrls(final ClassLoader classLoader, final ClassLoader excludeParent) throws IOException { UrlSet urlSet = new UrlSet(classLoader); if (excludeParent != null) { urlSet = urlSet.exclude(excludeParent); } return urlSet.getUrls(); }
private static Collection<URL> getUrls(ClassLoader classLoader, ClassLoader excludeParent) throws IOException { UrlSet urlSet = new UrlSet(classLoader); if (excludeParent != null){ urlSet = urlSet.exclude(excludeParent); } return urlSet.getUrls(); }
public static UrlSet filterArchives(final Filter filter, final ClassLoader classLoader, UrlSet urlSet) { for (final URL url : urlSet.getUrls()) { for (final Archive archive : ClasspathArchive.archives(classLoader, url)) { final FilteredArchive filtered = new FilteredArchive(archive, filter); if (!filtered.iterator().hasNext()) { urlSet = urlSet.exclude(url); } } } return urlSet; }
private List<URL> getUrls(StandardContext standardContext) { List<URL> urls = null; try { ClassLoader classLoader = standardContext.getLoader().getClassLoader(); UrlSet urlSet = new UrlSet(classLoader); urlSet = urlSet.exclude(classLoader.getParent()); urls = urlSet.getUrls(); } catch (IOException e) { logger.warning("Unable to determine URLs in web application " + standardContext.getPath(), e); } return urls; }