{
try
{
URL[] urls = ClasspathUtils.getUrls(unit);
DeploymentUnitScanner scanner = new DeploymentUnitScanner(unit, urls);
AnnotationsScanningPlugin plugin = createPlugin(unit);
scanner.addPlugin(plugin);
configureScanner(scanner);
scanner.scan();
AnnotationRepository repository = unit.getAttachment(plugin.getAttachmentKey(), AnnotationRepository.class);
unit.addAttachment(AnnotationRepository.class, repository);
}
catch (Exception e)
{
throw DeploymentException.rethrowAsDeploymentException("Exception visiting module", e);