Skip to content
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

ComponentFinder - Support for multiple packages to scan (multi-module builds) #44

Closed
engrun opened this issue Dec 21, 2016 · 0 comments · Fixed by #96
Closed

ComponentFinder - Support for multiple packages to scan (multi-module builds) #44

engrun opened this issue Dec 21, 2016 · 0 comments · Fixed by #96

Comments

@engrun
Copy link

engrun commented Dec 21, 2016

Hi

Field/parameter "packageToScan" is now a String value, limiting packages to scan to one single package. As I do not want to scan the entire codebase, it would be convenient to be able to list multiple sub-packages to scan.

It seems like a quick fix in AbstractReflectionsComponentFinderStrategy

.filterInputsBy(new FilterBuilder().includePackage(componentFinder.getPackageToScan()))

the includePackage method in the reflections API takes a vararg of Strings, making it possible to easily refactor ComponentFinder to accept a list/array of packages to scan.

essentially changing this line to

.filterInputsBy(new FilterBuilder().includePackage(componentFinder.getPackagesToScan()))

that is, changing getPackageToScan to getPackagesToScan

This is also very relevant for multi-module builds.
E.g. when controllers depend upon services/repositories from other maven-modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant