Is it possible to mix –class-path and –module-path in javac (JDK 9)?

You can use class path and module path in parallel, but there are a few details to consider. Dependency Module Path ~> Class Path Explicit modules (JARs with a module descriptor on the module path) can not read the unnamed module (JARs on the class path) – that was done on purpose to prevent modular … Read more

How to ignore classes in test class with ArchUnit

It seems that the API is not guiding very well with respect to this, because you’re not the first one wondering about this (this was also issue #1 on Github https://github.com/TNG/ArchUnit/issues/1). To answer the question though, the Annotation @AnalyseClasses has an extra attribute importOptions, which takes arbitrary implementations of ImportOption. There you can specify which … Read more

Finding Resources with PathMatchingResourcePatternResolver and URLClassloader in JARs

Loading the files dynamically in Spring is simple, I’d change the approach to finding the files with extensions. Try the following: ClassLoader cl = this.getClass().getClassLoader(); ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(cl); Resource[] resources = resolver.getResources(“classpath*:/*.xml”) ; for (Resource resource: resources){ logger.info(resource.getFilename()); }

Can I create a custom classpath on a per application basis in Tomcat

From Tomcat 7 there is no mention of not being able to use the VirtualWebappLoader in production. I tried it and it works like a dream. Simply add the following to META-INF/context.xml: <?xml version=”1.0″ encoding=”UTF-8″?> <Context antiJARLocking=”true” path=”/websandbox”> <Loader className=”org.apache.catalina.loader.VirtualWebappLoader” virtualClasspath=”/usr/…/*.jar;/usr/…/*.jar”/> </Context> In Netbeans, under packaging, I just untick all the packages, taking the .war … Read more

using classpath: in spring

Does classpath: search for resource relative to the document in which it is specified(in case of web applications)? No, classpath: is always relative to the classpath root. If you put a / at the start of the path, it is silently removed. Is it more fast to search if i give direct location of resource … Read more