in src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java [149:205]
protected void executeWithArtifacts() throws MojoExecutionException {
try {
final Map<String, String> props = new HashMap<String, String>();
props.put(SharedConstants.SLING_HOME, slingHome);
// ensure launchpad is set
props.put(SharedConstants.SLING_LAUNCHPAD, slingHome);
if (forceBundleLoad) {
props.put(SharedConstants.FORCE_PACKAGE_BUNDLE_LOADING, "true");
}
// set up and configure Felix Logger
int logLevelNum;
if (logLevel == null) {
logLevelNum = DEFAULT_LOG_LEVEL;
} else {
logLevelNum = toLogLevelInt(logLevel, DEFAULT_LOG_LEVEL);
}
props.put(LOG_LEVEL_PROP, String.valueOf(logLevelNum));
// Display port number on console, in case HttpService doesn't
getLog().info("HTTP server port: " + httpPort);
props.put(PROP_PORT, String.valueOf(httpPort));
// prevent tons of needless WARN from the framework
Logger logger = new Logger();
logger.setLogLevel(Logger.LOG_ERROR);
if (propertiesFile.exists()) {
File tmp = null;
try {
tmp = File.createTempFile("sling", "props");
mavenFileFilter.copyFile(propertiesFile, tmp, true, project, Collections.EMPTY_LIST, true,
System.getProperty("file.encoding"), mavenSession);
Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
for (Object key : loadedProps.keySet()) {
props.put((String) key, (String) loadedProps.get(key));
}
} catch (IOException e) {
throw new MojoExecutionException("Unable to create filtered properties file", e);
} catch (MavenFilteringException e) {
throw new MojoExecutionException("Unable to create filtered properties file", e);
} finally {
if (tmp != null) {
tmp.delete();
}
}
}
sling = startSling(resourceProvider, props, logger);
} catch (BundleException be) {
getLog().error("Failed to Start OSGi framework", be);
}
}