|
Next, change your code that constructs the Reflections object to look
like the following. Change com.your.package.here
and
YourSupertypeClass.class
to match your codebase.
URL urlModelClasses = ClasspathHelper.forClass(AbstractBlock.class); if (urlModelClasses.toString().startsWith("jar:")) { // Special one-jar URL handler breaks normal handling, so only use it if we are running via one-jar Vfs.setDefaultURLTypes(Arrays.asList(new OneJarUrlType())); } Reflections reflections = new Reflections(new ConfigurationBuilder() .setUrls(ClasspathHelper.forPackage("com.your.package.here")) .addUrls(ClasspathHelper.forClass(YourSupertypeClass.class)) .setScanners(new SubTypesScanner()));
Copyright © 2024 Andrew Oliver