Set<Resource> eclipseProjects = new HashSet<Resource>();
// Scan plugins exploded as unpacked JAR directories
for (File projectFolder : folder.listFiles(m_DirectoryFilter)) {
eclipseProjects.add(new FileSystemResource(projectFolder));
}
for (Resource resource : eclipseProjects) {
Manifest man = getManifestFromProject(resource);
if (man != null) {
addPlugin(plugins, resource, man, true);
} else {
// this is not a project folder, so descend to find potential nested modules
List<String> list = Arrays.asList( ((FileSystemResource)resource).getFile().list() );
for ( String str : list ) {
// do not process eclipse proejcts at the moment
if ( str.contains( "drools-eclipse" ) || str.contains( "osgi-bundles" ) ) {
list = null;
}
}
if ( list != null && list.contains("pom.xml")) {
importPluginFromFolder(((FileSystemResource)resource).getFile(), plugins);
}
}
}
Set<Resource> packagedBundles = new HashSet<Resource>();
// Scan plugins provided as JAR files
for (File jarFile : folder.listFiles(m_JARFileFilter))
packagedBundles.add(new FileSystemResource(jarFile));
for (Resource resource : packagedBundles) {
Manifest man = getManifestFromJAR(resource);
if (man != null)
addPlugin(plugins, resource, man, false);