diff --git a/bin/libs/component.ts b/bin/libs/component.ts index 2f8611db9c..457a12364c 100644 --- a/bin/libs/component.ts +++ b/bin/libs/component.ts @@ -116,32 +116,33 @@ function showExceptions(e: any,depth: number): void { export function getPluginDefinition(pluginRootPath:string, continueOnFailure?: boolean) { const pluginDefinitionPath = `${pluginRootPath}/pluginDefinition.json`; + const configId = `appfwPlugin:${pluginRootPath}`; const printer = continueOnFailure ? common.printError : common.printErrorAndExit; if (fs.fileExists(pluginDefinitionPath)) { let status; - if ((status = CONFIG_MGR.addConfig(pluginRootPath))) { + if ((status = CONFIG_MGR.addConfig(configId))) { printer(`Could not add config for ${pluginRootPath}, status=${status}`); return null; } - if ((status = CONFIG_MGR.loadSchemas(pluginRootPath, PLUGIN_DEF_SCHEMAS))) { + if ((status = CONFIG_MGR.loadSchemas(configId, PLUGIN_DEF_SCHEMAS))) { printer(`Could not load schemas ${PLUGIN_DEF_SCHEMAS} for plugin ${pluginRootPath}, status=${status}`); return null; } - if ((status = CONFIG_MGR.setConfigPath(pluginRootPath, `FILE(${pluginDefinitionPath})`))) { + if ((status = CONFIG_MGR.setConfigPath(configId, `FILE(${pluginDefinitionPath})`))) { printer(`Could not set config path for ${pluginDefinitionPath}, status=${status}`); return null; } - if ((status = CONFIG_MGR.loadConfiguration(pluginRootPath))) { + if ((status = CONFIG_MGR.loadConfiguration(configId))) { printer(`Could not load config for ${pluginDefinitionPath}, status=${status}`); return null; } - let validation = CONFIG_MGR.validate(pluginRootPath); + let validation = CONFIG_MGR.validate(configId); if (validation.ok){ if (validation.exceptionTree){ common.printError(`Validation of ${pluginDefinitionPath} against schema ${PLUGIN_DEF_SCHEMA_ID} found invalid JSON Schema data`); @@ -151,7 +152,7 @@ export function getPluginDefinition(pluginRootPath:string, continueOnFailure?: b } return null; } else { - return CONFIG_MGR.getConfigData(pluginRootPath); + return CONFIG_MGR.getConfigData(configId); } } else { printer(`Error occurred on validation of ${pluginDefinitionPath} against schema ${PLUGIN_DEF_SCHEMA_ID} `);