Simplify the InterpolationHelper, use 'env.' to align with maven #676

This commit is contained in:
Guillaume Nodet
2022-08-30 11:30:15 +02:00
parent 8f9e59bab2
commit 0299a38264
2 changed files with 24 additions and 133 deletions

View File

@@ -454,8 +454,10 @@ public class DaemonParameters {
if (Files.exists(path)) {
try (InputStream in = Files.newInputStream(path)) {
result.load(in);
InterpolationHelper.performSubstitution((Map<String, String>) (Map) result,
new InterpolationHelper.SystemPropertiesSubstitutionCallback());
Properties sysProps = new Properties();
sysProps.putAll(System.getProperties());
System.getenv().forEach((k, v) -> sysProps.put(k, ENV_PREFIX + v));
InterpolationHelper.performSubstitution(result, sysProps::getProperty, true, true);
} catch (IOException e) {
throw new RuntimeException("Could not read " + path);
}