reflections
reflections copied to clipboard
Reflections 0.10 doesn't respect constructor's package parameter
val reflections = Reflections("xxx")
val generator = Generator()
val classes = reflections.get(Scanners.TypesAnnotated.with(ApiModel::class.java).asClass<Any>())
but some class in package yyy with ApiModel annotation also be scanned, how to fix this problem?
I'm also experiencing this issue.
Set<Method> scannedMethods = new Reflections(
new ConfigurationBuilder()
.forPackages("x.y.z", "x.y.x")
.setScanners(org.reflections.scanners.Scanners.MethodsAnnotated))
.getMethodsAnnotatedWith(MyAnnotation.class);
with the code above, scannedMethods
yields results not only from x.y.z
and x.y.x
packages, but from all the classpath.