New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code scanners should exclude META-INF by default #184
Comments
Hi, I tried to reproduce the issue and what I found is that this is happening only when you create a new instance of Reflections without passing any parameter, maybe you should try to restrict the search to a package or something similar. |
The issue actually is in kotlintest which I'm using, see here:
So kotlintest is looking for a ProjectConfig class that could be in any package. Any suggestions how to restrict the search in this case? |
The issue persists even if a package specified: Reflections reflections = new Reflections(
new ConfigurationBuilder()
.setUrls(ClasspathHelper.forPackage("my.package"))
.setScanners(new SubTypesScanner())
); Log for
Log for the
|
@mmdemirbas can you try with 0.9.10? |
Hi there, Can it be related to this? |
Using 0.9.11 I get a similar issue with warnings about .sql files etc. Supplying the package didn't help (the .sql files are in the same directories as some classes). Instead after lots of trial and error I found I needed to use
However I agree that this might be best as default behaviour, or at least a simple method call to enable this behaviour. It's a lot of boilerplate for what I assume will be the most common use. Some clearer details on this in the docs and example on how to limit to just classes would help. |
I came across same issue, seeing exceptions when debug enabled, and this got fixed after upgrading to |
Scanners that are only supposed to scan code (and not resources) should by default have a path filter to exclude the
META-INF
directory. Otherwise, if logging is enabled, the log gets cluttered with output likefor a simple call to
getSubTypesOf()
.The text was updated successfully, but these errors were encountered: