{
DeploymentResourceLoader loader = new VFSDeploymentResourceLoaderImpl(root);
ClassLoader classLoader = new DeploymentResourceClassLoader(loader);
try
{
DefaultScanner scanner = new DefaultScanner(classLoader, root.toURL());
AnnotationsScanningPlugin plugin = new AnnotationsScanningPlugin(classLoader)
{
@Override
public ResourceFilter getRecurseFilter()
{
return recurseFilter;
}
};
scanner.addPlugin(plugin);
scanner.setIncluded(included);
scanner.setExcluded(excluded);
scanner.scan();
return (AnnotationRepository) scanner.getHandles().get(plugin);
}
catch (Exception e)
{
throw new RuntimeException("Cannot create annotation repository: " + e);
}