Skip to content

Restrict scanning for concrete types over specific packages #471

@npepinpe

Description

@npepinpe

Class scanning is a great feature, but depending on the size of your project, it leads to some minor issues. For example, I'd like to use EasyRandom as part of the test harness for a project. The test harness has its own module as it gets included into different module. Scanning for types may end up finding different implementations of the interfaces depending on the module in which the test harness is pulled. I'm sure that's a nice use case for some, but it can also lead to some issues. For example, the test harness module already pulls in a dependency which has concrete implementations of some types. These are beans and can easily be generated by EasyRandom. However, maybe in another module, there are other implementations which run into limitations of EasyRandom, or which aren't strictly beans. In this case, it would be great if I could specify which implementations to use.

Secondly, scanning the whole class path can be prohibitively expensive. This isn't a big overhead when running a complete test suite, but when running single tests in your IDE having it add a few seconds for a test which takes 5 milliseconds is a bit tedious.

Now, neither are blockers, but restricting the scanning to specific packages seems like a pretty easy fix - this is already supported by ClassGraph, and it would fix both issues.

Let me know if I wasn't clear. If this is something you'd consider, I'm also happy opening the PR myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions