Skip to content

Commit

Permalink
loading of icf connectors fixed, now works for standalone springboot …
Browse files Browse the repository at this point in the history
…as well as for standard war
  • Loading branch information
1azyman committed Sep 30, 2017
1 parent e8379b6 commit 149fc0a
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -577,14 +577,26 @@ private Set<URL> scanClassPathForBundles() {
} catch (IOException ex) {
LOGGER.trace("Unable load: " + u + " [" + ex.getMessage() + "]");
}
// tomcat
// toString >>> jar:file:/<ABSOLUTE_PATH_TO_TOMCAT_WEBAPPS>/midpoint/WEB-INF/lib/connector-csv-2.1-SNAPSHOT.jar!/META-INF/MANIFEST.MF
// getPath >>> file:/<ABSOLUTE_PATH_TO_TOMCAT_WEBAPPS>/WEB-INF/lib/connector-csv-2.1-SNAPSHOT.jar!/META-INF/MANIFEST.MF

// boot
// toString >>> jar:file:/<ABSOLUTE_PATH_TO_WAR_FOLDER>/midpoint.war!/WEB-INF/lib/connector-csv-2.1-SNAPSHOT.jar!/META-INF/MANIFEST.MF
// getPath >>> file:/<ABSOLUTE_PATH_TO_WAR_FOLDER>/midpoint.war!/WEB-INF/lib/connector-csv-2.1-SNAPSHOT.jar!/META-INF/MANIFEST.MF

if (null != prop.get("ConnectorBundle-Name")) {
LOGGER.info("Discovered ICF bundle on CLASSPATH: " + prop.get("ConnectorBundle-Name") + " version: "
+ prop.get("ConnectorBundle-Version"));

// hack to split MANIFEST from name
try {
String upath = u.getPath();
String upath = u.toString();
if (upath.split("!/").length != 3) {
// we're running standard war in application server
upath = u.getPath();
}

URL tmp = new URL(toUrl(upath.substring(0, upath.lastIndexOf("!"))));
if (isThisBundleCompatible(tmp)) {
bundle.add(tmp);
Expand Down

0 comments on commit 149fc0a

Please sign in to comment.