Skip to content

Commit

Permalink
Merge pull request wso2#100 from Vathsan/sys-prop
Browse files Browse the repository at this point in the history
Fix the issue in starting MI when toml configuration is skipped
  • Loading branch information
Vathsan committed Feb 2, 2021
2 parents 305cbd1 + 639b82b commit bf2de06
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public class Main {
protected static final String P2_DATA_AREA = "eclipse.p2.data.area";
protected static final String ENABLE_EXTENSIONS = "wso2.enableExtensions";
protected static final String DEPLOYMENT_CONFIG_FILE_PATH = "deployment.config.file.path";
protected static final String AVOID_CONFIGURATION_UPDATE = "avoidConfigUpdate";
protected static final String ONLY_PARSE_CONFIGURATION = "configParseOnly";

static File platformDirectory;
private static Log logger = LogFactory.getLog(Main.class);
Expand Down Expand Up @@ -357,7 +359,13 @@ private static void handleConfiguration() {
configFilePath = Paths.get(System.getProperty(LauncherConstants.CARBON_CONFIG_DIR_PATH),
ConfigParser.UX_FILE_PATH).toString();
}

// As deployment.toml is mandatory, set avoidConfigUpdate to false and configParseOnly to true
if (Boolean.getBoolean(AVOID_CONFIGURATION_UPDATE)) {
logger.warn("System property 'configParseOnly' will be set to true instead of " +
"'avoidConfigUpdate' as deployment.toml configuration is mandatory.");
System.setProperty(AVOID_CONFIGURATION_UPDATE, "false");
System.setProperty(ONLY_PARSE_CONFIGURATION, "true");
}
String outputDir = System.getProperty(LauncherConstants.CARBON_HOME);
try {
ConfigParser.parse(configFilePath, resourcesDir, outputDir);
Expand Down

0 comments on commit bf2de06

Please sign in to comment.