common/src/main/java/org/jboss/pnc/common/util/StringUtils.java
public static String replaceEnv(String configString) {
        Properties properties = new Properties();
        
        for (Map.Entry<String, String> entry : System.getenv().entrySet()) {
            properties.put("env." + entry.getKey(), entry.getValue());
        }
        String replaced = StringPropertyReplacer.replaceProperties(configString, properties);
        //remove env placeholders that were not replaced with values
        return replaced.replaceAll("\\$\\{env\\..+\\}", "");
    }
public static String replaceEnv(String configString) {
        Properties properties = new Properties();
        
        for (Map.Entry<String, String> entry : System.getenv().entrySet()) {
            properties.put("env." + entry.getKey(), entry.getValue());
        }
        String replaced = StringPropertyReplacer.replaceProperties(configString, properties);
        //remove env placeholders that were not replaced with values
        return replaced.replaceAll("\\$\\{env\\..+\\}", "");
    }
Replace environment variables in string.
Environment variables are expected in format ${env.ENV_PROPERTY},
where "env" is static prefix and ENV_PROPERTY is name of environment property.

@param configString String with environment variables
@return String with replaced environment variables