continue bundles;
}
Path p = bundleToPath(frameworkLocation, b);
- classpath.add(p.toString());
+ if (p != null)
+ classpath.add(p.toString());
}
return classpath.toString();
static Path bundleToPath(Path frameworkLocation, Bundle bundle) throws IOException {
String location = bundle.getLocation();
- if (location.startsWith("initial@reference:file:")) {
+ if (location.startsWith("initial@reference:file:")) {// Eclipse IDE environment
location = location.substring("initial@reference:file:".length());
- Path p = frameworkLocation.getParent().resolve(location).toRealPath();
- // TODO load dev.properties from OSGi configuration directory
- if (Files.isDirectory(p))
- p = p.resolve("bin");
- return p;
+ Path p = frameworkLocation.getParent().resolve(location).toAbsolutePath();
+ if (Files.exists(p)) {
+ p = p.toRealPath();
+ // TODO load dev.properties from OSGi configuration directory
+ if (Files.isDirectory(p))
+ p = p.resolve("bin");
+ return p;
+ } else {
+ log.warn("Ignore bundle " + p + " as it does not exist");
+ return null;
+ }
+ } else if (location.startsWith("reference:file:")) {// a2+reference
+ location = location.substring("reference:".length());
+ Path p = Paths.get(URI.create(location));
+ if (Files.exists(p)) {
+ return p;
+ } else {
+ log.warn("Ignore bundle " + p + " as it does not exist");
+ return null;
+ }
}
Path p = Paths.get(location);
return p;