try
{
URL[] urls = ClasspathUtils.getUrls(unit);
DefaultAnnotationScanner scanner = new ModuleAnnotationScanner(module);
AbstractConfiguration config = new DefaultConfiguration();
configureScanner(unit, scanner, config);
if (configuration != null)
config.merge(configuration); // override with custom config
scanner.setConfiguration(config);
AnnotationRepository repository = scanner.scan(unit.getClassLoader(), urls);
unit.addAttachment(AnnotationRepository.class, repository);
}