Use interpolation when loading properties, fixes #676 (#677)

This commit is contained in:
Guillaume Nodet
2022-08-29 22:12:15 +02:00
committed by GitHub
parent a8a70212d2
commit dc69f258be
2 changed files with 370 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ import org.apache.maven.cli.internal.extension.model.io.xpp3.CoreExtensionsXpp3R
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.mvndaemon.mvnd.common.Environment;
import org.mvndaemon.mvnd.common.InterpolationHelper;
import org.mvndaemon.mvnd.common.Os;
import org.mvndaemon.mvnd.common.SocketFamily;
import org.mvndaemon.mvnd.common.TimeUtils;
@@ -451,6 +452,8 @@ 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() );
} catch (IOException e) {
throw new RuntimeException("Could not read " + path);
}